Files
isaac-port/generated-src/entity_tear.cpp
T
shweetandClaude Opus 5.5 3ce74c6e2d Reconstruction layout: generated-src/ (generated) and src/ (curated), CMake, the first takeover: RNG
The decompiled C++ tree moves to generated-src/ (classes.h, C++20); src/ is for code written by hand. A curated function
defines the generated declaration and starts its comment with its address, and source_tree.py stops emitting that body.
src/rng.cpp takes over RNG (SetSeed, the constructor, Next, RandomInt, RandomFloat, Shuffle) with the shift table read
from the exe as a constexpr array; src/log.h names KAGE_LogMessage's levels (1 INFO, 2 NET, 4 WARN, 8 ERROR, 16 ASSERT,
from its prefix jump table). CMakeLists.txt builds src/*.cpp against generated-src/classes.h (clean with -Wall -Wextra).
structs.hpp and headers.py are retired: scripts/merge_fields.py writes the merged field list, classes.h checks the layout.

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

9592 lines
477 KiB
C++

#include "classes.h"
// 004177c0
BitSet128 * Entity_Tear::TearFlags(BitSet128 *outFlags)
{
undefined4 uVar1;
undefined4 uVar2;
qword qVar3;
uVar1 = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4));
qVar3 = (this->_tearFlags)._h;
uVar2 = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4));
*GHIDRA_CAST<int *>(&outFlags->_l) = GHIDRA_INT((this->_tearFlags)._l);
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&outFlags->_l) + 4)) = uVar1;
*GHIDRA_CAST<int *>(&outFlags->_h) = GHIDRA_INT(qVar3);
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&outFlags->_h) + 4)) = uVar2;
return outFlags;
}
// 00431750
float10 Entity_Tear::Height()
{
return (float10)this->_height;
}
// 00435e50
float10 Entity_Tear::FallingAcceleration()
{
return (float10)this->_fallingAccel;
}
// 00456440
float10 Entity_Tear::FallingSpeed()
{
return (float10)this->_fallingSpeed;
}
// 004aade0
int Entity_Tear::TearIndex()
{
return this->_tearIdx;
}
// 00557cd0
float10 Entity_Tear::Scale()
{
return (float10)this->_fScale;
}
// 0060ccb0
float10 Entity_Tear::BaseScale()
{
return (float10)this->_baseScale;
}
// 0060ccc0
float10 Entity_Tear::Rotation()
{
return (float10)this->_rotation;
}
// 0060ccd0
void Entity_Tear::SetKnockbackMultiplier(float param_2)
{
this->_knockbackMultiplier = param_2;
return;
}
// 0060cd00
void Entity_Tear::SetWaitFrames(int param_2)
{
this->_waitFrames = param_2;
return;
}
// 00665b00
Entity_Player * Entity_Tear::GetRootPlayer()
{
EntityPtr nextSpawner;
EntityPtr spawner;
nextSpawner = this->_spawnerEntity;
while (spawner = nextSpawner, spawner != (EntityPtr)0x0) {
this = GHIDRA_CAST<Entity_Tear *>(spawner);
nextSpawner = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(spawner) + 0x3c8));
}
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x28)) != 1) {
this = GHIDRA_CAST<Entity_Tear *>(0x0);
}
return GHIDRA_CAST<Entity_Player *>(this);
}
// 00665cf0
void Entity_Tear::Constructor()
{
void *local_10;
undefined1 *puStack_c;
undefined4 local_8;
local_8 = 0xffffffff;
puStack_c = &LAB_00af776d;
local_10 = ExceptionList;
ExceptionList = &local_10;
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::constructor();
*GHIDRA_CAST<undefined ***>(this) = IsaacRepentancePlus::Entity_Tear::vftable;
*GHIDRA_CAST<undefined4 *>(&(this->_tearFlags)._l) = 0;
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4)) = 0;
*GHIDRA_CAST<undefined4 *>(&(this->_tearFlags)._h) = 0;
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4)) = 0;
(this->_continueVelocity).y = 0.0;
(this->_continueVelocity).x = 0.0;
(this->_hitList)._begin = (void *)0x0;
(this->_hitList)._end = (void *)0x0;
(this->_hitList)._capacity = (void *)0x0;
(this->_stickDiff).y = 0.0;
(this->_stickDiff).x = 0.0;
this->_linkPrev = (EntityPtr)0x0;
this->_linkNext = (EntityPtr)0x0;
this->_attachedEffect = (EntityPtr)0x0;
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4a0)))) = 0;
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4a4)))) = 0;
local_8 = 6;
(GHIDRA_CAST<ANM2 *>((&this->_tearHaloANM2)))->ANM2::constructor();
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 7;
(GHIDRA_CAST<ANM2 *>((&this->_tearEffectANM2)))->ANM2::constructor();
local_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),8);
(GHIDRA_CAST<ANM2 *>((&this->_deadEyeANM2)))->ANM2::constructor();
(this->_posDisplacement).y = 0.0;
(this->_posDisplacement).x = 0.0;
(this->_parentOffset).y = 0.0;
(this->_parentOffset).x = 0.0;
(this->_holdOffset).y = 0.0;
(this->_holdOffset).x = 0.0;
(this->_holdVelocity).y = 0.0;
(this->_holdVelocity).x = 0.0;
(this->_orbitVelocity).y = 0.0;
(this->_orbitVelocity).x = 0.0;
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x828)))) = 0;
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x82c)))) = 0;
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x830)))) = 0;
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x834)))) = 0;
ExceptionList = local_10;
return;
}
// 006660a0
void Entity_Tear::Init(int type, int variant, int subType, uint initSeed)
{
uint uVar1;
LayerState *layer;
int iVar2;
char *pcVar3;
float heightOffsetY;
EntityPtr *local_48;
std_string bulletAnm2Path;
std_string local_2c;
uint local_14;
void *local_10;
undefined1 *puStack_c;
uint local_8;
Game *game;
byte *layerIndex;
EntityPtr *linkPrevSlot;
local_8 = 0xffffffff;
puStack_c = &LAB_00af77c5;
local_10 = ExceptionList;
local_14 = __security_cookie ^ GHIDRA_UINT(&(&local_2c)[1]._size);
ExceptionList = &local_10;
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::Init(type,variant,subType,initSeed);
if (this->_config != (void *)0x0) {
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Load(GHIDRA_CAST<std_string *>((GHIDRA_INT(this->_config) + 0x74)),1);
}
this->_entityGridCollisionClass = 4;
this->_collisionDamage = 3.5;
this->_baseDamage = 3.5;
uVar1 = Random();
this->_fallingAccel = 0.0;
this->_height = -23.0;
this->_fallingSpeed =
((float)((double)GHIDRA_INT(uVar1) + __uint_to_double_fixup[-(GHIDRA_INT(uVar1) >> 0x1f)]) * 2.3283064e-10
- 0.5) * 0.2;
heightOffsetY = get_height_offset_y(this,-23.0);
game = g_game;
(this->_posOffset).y = heightOffsetY;
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 8)) == 0x10) {
(this->_posOffset).y = -18.0;
}
this->_homingFriction = 0.85;
linkPrevSlot = &this->_linkPrev;
this->_fScale = 1.0;
this->_baseScale = 1.0;
this->_rotation = 0.0;
this->_scaleAnimNum = -1;
this->_knockbackMultiplier = 1.7;
this->_maxHitPoints = 0.0;
*GHIDRA_CAST<undefined4 *>(&(this->_tearFlags)._l) = 0;
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4)) = 0;
*GHIDRA_CAST<undefined4 *>(&(this->_tearFlags)._h) = 0;
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4)) = 0;
this->_waitFrames = 0;
(this->_continueVelocity).x = g_vectorZero.x;
(this->_continueVelocity).y = g_vectorZero.y;
(this->_hitList)._end = (this->_hitList)._begin;
(this->_posDisplacement).x = g_vectorZero.x;
(this->_posDisplacement).y = g_vectorZero.y;
(this->_parentOffset).x = g_vectorZero.x;
(this->_parentOffset).y = g_vectorZero.y;
this->_stickTarget = (void *)0x0;
(this->_stickDiff).x = g_vectorZero.x;
(this->_stickDiff).y = g_vectorZero.y;
this->_techZeroLaser = (EntityPtr)0x0;
this->_techZeroTarget = (EntityPtr)0x0;
this->_laserShotLaser = (EntityPtr)0x0;
if (*linkPrevSlot != (EntityPtr)0x0) {
local_48 = linkPrevSlot;
std::multiset<unsigned_int>::erase(&local_48);
*linkPrevSlot = (EntityPtr)0x0;
}
if (this->_linkNext != (EntityPtr)0x0) {
local_48 = &this->_linkNext;
std::multiset<unsigned_int>::erase(&local_48);
this->_linkNext = (EntityPtr)0x0;
}
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4a8)))) = 0;
this->_deadEyeIntensity = 0.0;
this->_multidimensionalTouched = 0;
this->_prismTouched = 0;
this->_isFireSoundPending = 1;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x46b))) = 0;
this->_canTriggerStreakEnd = 1;
this->_isHovering = 0;
this->_isFireSoundMuted = 0;
(this->_holdOffset).x = g_vectorZero.x;
(this->_holdOffset).y = g_vectorZero.y;
this->_holdTimer = 0;
*GHIDRA_CAST<undefined4 *>(&this->_popBounceCount) = 0;
this->_hitCount = 0;
this->_deathFlags = 0;
uVar1 = g_graphicsManager_flags;
if (this->_variant == 0x25) {
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x1));
iVar2 = 1;
if ((uVar1 & 4) == 0) {
iVar2 = 6;
}
layer->_blendMode[0] = 0;
layer->_blendMode[1] = iVar2;
layer->_blendMode[2] = 1;
layer->_blendMode[3] = 1;
layer->_blendMode[4] = 1;
}
this->_orbitAngle = 0.0;
this->_orbitRadius = 0.0;
(this->_orbitVelocity).x = g_vectorZero.x;
(this->_orbitVelocity).y = g_vectorZero.y;
this->_tearRange = 260.0;
this->_tearIdx = -1;
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x828)))) = 0;
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x82c)))) = 0;
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x830)))) = 0;
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x834)))) = 0;
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x838)))) = 0;
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x83c)))) = 0x1e;
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x840)))) = 0x3c75c28f;
game = g_game;
if (this->_variant == 0xd) {
local_48 = GHIDRA_CAST<EntityPtr *>(&DAT_0000004f);
std::set<int>::find_node(local_2c._buf + 0xc,&local_48);
if (((*GHIDRA_CAST<char *>((local_2c._capacity + 0xd)) != '\0') ||
(0x4f < *GHIDRA_CAST<int *>((local_2c._capacity + 0x10)))) ||
((void *)local_2c._capacity == (game->_seedEffects)._seedEffects)) goto LAB_0066669b;
bulletAnm2Path._size = 0;
bulletAnm2Path._capacity = 0xf;
bulletAnm2Path._buf[0] = '\0';
bulletAnm2Path._buf[1] = '\0';
bulletAnm2Path._buf[2] = '\0';
bulletAnm2Path._buf[3] = '\0';
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(bulletAnm2Path._buf)) + 0x0))) = std::_Allocate(0x30);
bulletAnm2Path._size = 0x20;
bulletAnm2Path._capacity = 0x2f;
builtin_strncpy((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(bulletAnm2Path._buf))) + 0x0))),"gfx/promo/gfuel/bullet tear.anm2",0x21);
local_8 = 0;
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Load(&bulletAnm2Path,1);
local_8 = 0xffffffff;
if (0xf < bulletAnm2Path._capacity) {
uVar1 = bulletAnm2Path._capacity + 1;
pcVar3 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(bulletAnm2Path._buf))) + 0x0)));
if (0xfff < uVar1) {
pcVar3 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(bulletAnm2Path._buf)) + 0x0))) + -4));
uVar1 = bulletAnm2Path._capacity + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(bulletAnm2Path._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar3))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pcVar3,uVar1);
}
layerIndex = GHIDRA_CAST<byte *>(0x0);
}
else {
if (this->_variant != 0x17) goto LAB_0066669b;
local_48 = GHIDRA_CAST<EntityPtr *>(&DAT_0000004f);
std::set<int>::find_node(local_2c._buf + 0xc,&local_48);
if (((*GHIDRA_CAST<char *>((local_2c._capacity + 0xd)) != '\0') ||
(0x4f < *GHIDRA_CAST<int *>((local_2c._capacity + 0x10)))) ||
((void *)local_2c._capacity == (game->_seedEffects)._seedEffects)) goto LAB_0066669b;
local_2c._size = 0;
local_2c._capacity = 0xf;
local_2c._buf[0] = '\0';
local_2c._buf[1] = '\0';
local_2c._buf[2] = '\0';
local_2c._buf[3] = '\0';
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_2c._buf)) + 0x0))) = std::_Allocate(0x20);
local_2c._size = 0x1c;
local_2c._capacity = 0x1f;
builtin_strncpy((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_2c._buf))) + 0x0))),"gfx/promo/gfuel/missile.anm2",0x1d);
local_8 = 1;
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Load(&local_2c,1);
local_8 = 0xffffffff;
if (0xf < local_2c._capacity) {
uVar1 = local_2c._capacity + 1;
pcVar3 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_2c._buf))) + 0x0)));
if (0xfff < uVar1) {
pcVar3 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_2c._buf)) + 0x0))) + -4));
uVar1 = local_2c._capacity + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_2c._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar3))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pcVar3,uVar1);
}
local_2c._size = 0;
local_2c._capacity = GHIDRA_UINT(&DAT_0000000f);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_2c._buf)) + 0x0))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_2c._buf)) + 0x0))) & 0xffffff00;
layerIndex = GHIDRA_CAST<byte *>(0x1);
}
uVar1 = g_graphicsManager_flags;
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(layerIndex);
iVar2 = 1;
if ((uVar1 & 4) == 0) {
iVar2 = 6;
}
layer->_blendMode[4] = 1;
layer->_blendMode[3] = 1;
layer->_blendMode[2] = 1;
layer->_blendMode[1] = iVar2;
layer->_blendMode[0] = 0;
LAB_0066669b:
FUN_008629c0(this);
ExceptionList = local_10;
return;
}
// 006666c0
void Entity_Tear::ClearReferences()
{
EntityPtr EVar1;
Entity_Tear *apEStack_c [2];
int childType;
EntityPtr *laserShotSlot;
EntityPtr *refSlot;
refSlot = &this->_techZeroLaser;
apEStack_c[0] = this;
if (this->_techZeroLaser != (EntityPtr)0x0) {
(**(code **)(*GHIDRA_CAST<int *>(this->_techZeroLaser) + 0x28))();
}
laserShotSlot = &this->_laserShotLaser;
if (this->_laserShotLaser != (EntityPtr)0x0) {
(**(code **)(*GHIDRA_CAST<int *>(this->_laserShotLaser) + 0x28))();
}
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::ClearReferences();
(GHIDRA_CAST<ANM2 *>((&this->_tearHaloANM2)))->ANM2::Reset();
(GHIDRA_CAST<ANM2 *>((&this->_tearEffectANM2)))->ANM2::Reset();
(GHIDRA_CAST<ANM2 *>((&this->_deadEyeANM2)))->ANM2::Reset();
if (this->_stickTarget != (void *)0x0) {
apEStack_c[0] = GHIDRA_CAST<Entity_Tear *>(&this->_stickTarget);
std::multiset<unsigned_int>::erase(apEStack_c);
}
this->_stickTarget = (void *)0x0;
if (*refSlot != (EntityPtr)0x0) {
apEStack_c[0] = GHIDRA_CAST<Entity_Tear *>(refSlot);
std::multiset<unsigned_int>::erase(apEStack_c);
}
*refSlot = (EntityPtr)0x0;
refSlot = &this->_techZeroTarget;
if (*refSlot != (EntityPtr)0x0) {
apEStack_c[0] = GHIDRA_CAST<Entity_Tear *>(refSlot);
std::multiset<unsigned_int>::erase(apEStack_c);
}
*refSlot = (EntityPtr)0x0;
if (*laserShotSlot != (EntityPtr)0x0) {
apEStack_c[0] = GHIDRA_CAST<Entity_Tear *>(laserShotSlot);
std::multiset<unsigned_int>::erase(apEStack_c);
}
*laserShotSlot = (EntityPtr)0x0;
refSlot = &this->_linkPrev;
if (*refSlot != (EntityPtr)0x0) {
EVar1 = this->_linkNext;
if (EVar1 != (EntityPtr)0x0) {
if (*GHIDRA_CAST<int *>((GHIDRA_INT(*refSlot) + 0x28)) == 2) {
FUN_0067dac0(&this->_linkNext);
EVar1 = this->_linkNext;
}
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar1) + 0x28)) == 2) {
FUN_0067dac0(refSlot);
}
}
}
if (*refSlot != (EntityPtr)0x0) {
apEStack_c[0] = GHIDRA_CAST<Entity_Tear *>(refSlot);
std::multiset<unsigned_int>::erase(apEStack_c);
*refSlot = (EntityPtr)0x0;
}
if (this->_linkNext != (EntityPtr)0x0) {
apEStack_c[0] = GHIDRA_CAST<Entity_Tear *>(&this->_linkNext);
std::multiset<unsigned_int>::erase(apEStack_c);
this->_linkNext = (EntityPtr)0x0;
}
if (this->_attachedEffect != (EntityPtr)0x0) {
(**(code **)(*GHIDRA_CAST<int *>(this->_attachedEffect) + 0x28))();
}
if ((((GHIDRA_UINT((this->_tearFlags)._l) & GHIDRA_UINT(g_tearFlagLudovico._l)) != 0 ||
(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagLudovico._l)) + 0x4)))) != 0) ||
((GHIDRA_UINT((this->_tearFlags)._h) & GHIDRA_UINT(g_tearFlagLudovico._h)) != 0 ||
(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagLudovico._h)) + 0x4)))) != 0)) &&
(EVar1 = this->_child, EVar1 != (EntityPtr)0x0)) {
childType = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar1) + 0x28));
while (childType == 2) {
(**(code **)(*GHIDRA_CAST<int *>(EVar1) + 0x28))();
EVar1 = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(EVar1) + 0x3c0));
if (EVar1 == (EntityPtr)0x0) {
return;
}
childType = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar1) + 0x28));
}
}
return;
}
// 006668c0
void Entity_Tear::apply_wiggle(float strength)
{
float fVar1;
float fVar2;
Vector wiggleDir;
wiggleDir.x = (this->_velocity).y;
wiggleDir.y = -(this->_velocity).x;
fVar2 = wiggleDir.x * wiggleDir.x;
fVar1 = sqrtf(wiggleDir.y * wiggleDir.y + fVar2);
if (0.0 < fVar1) {
wiggleDir.x = (1.0 / fVar1) * wiggleDir.x;
wiggleDir.y = wiggleDir.y * (1.0 / fVar1);
}
fVar1 = (this->_velocity).x;
fVar1 = sqrtf(fVar1 * fVar1 + fVar2);
fVar1 = fVar1 * 0.5;
if (5.0 <= fVar1) {
fVar1 = 5.0;
}
if ((this->_tearIdx & 1) == 0) {
fVar2 = 0.0;
}
else {
fVar2 = 3.1415927;
}
fVar2 = cos(((float)(g_game->_frameCount - this->_spawnFrame) + 0.5) * 0.7 + fVar2);
fVar2 = fVar2 * fVar1 * strength;
(this->_pos).x = wiggleDir.x * fVar2 + (this->_pos).x;
(this->_pos).y = wiggleDir.y * fVar2 + (this->_pos).y;
return;
}
// 00666ba0
void Entity_Tear::update_wiggle()
{
uint frameParity;
float cosPhase;
float speed;
float in_XMM1_Da;
float dirX;
float fVar1;
float dirY;
frameParity = g_manager->_framecount & 0x80000001;
if (GHIDRA_INT(frameParity) < 0) {
frameParity = (frameParity - 1 | 0xfffffffe) + 1;
}
dirY = (this->_velocity).y;
fVar1 = (float)(g_game->_frameCount - this->_spawnFrame) + (float)GHIDRA_INT(frameParity) * 0.5;
dirX = (this->_velocity).x;
if (ABS(dirX) <= ABS(dirY)) {
fVar1 = fVar1 * 0.2;
}
else {
fVar1 = -fVar1 * 0.2 + 1.5707964;
}
cosPhase = cos(fVar1);
fVar1 = sin(fVar1);
speed = sqrtf(dirX * dirX + dirY * dirY);
if (0.0 < speed) {
dirX = dirX * (1.0 / speed);
dirY = dirY * (1.0 / speed);
}
(this->_pos).x = cosPhase * dirY * 15.0 * in_XMM1_Da + cosPhase * dirX * 15.0 + (this->_pos).x;
(this->_pos).y = -dirX * fVar1 * 15.0 * in_XMM1_Da + fVar1 * dirY * 15.0 + (this->_pos).y;
return;
}
// 00666d40
void Entity_Tear::play_fire_sound()
{
int iVar1;
byte isSeedEffectActive;
uint tearFlagsWord2;
Manager *manager;
float fVar2;
int soundId;
uint local_10;
float dirY;
iVar1 = this->_variant;
this->_isFireSoundPending = 0;
manager = g_manager;
if ((((iVar1 != 9) && (iVar1 != 0x2e)) && (this->_isFireSoundMuted == 0)) && (iVar1 != 0x28)) {
if (iVar1 == 0x32) {
soundId = 0xed;
seed_fart_sound_override(&soundId);
fVar2 = 1.2;
}
else {
if (((iVar1 == 0xd) || (iVar1 == 0x17)) &&
(isSeedEffectActive = (GHIDRA_CAST<Seeds *>((&g_game->_seedEffects)))->Seeds::HasSeedEffect(0x4f),
isSeedEffectActive != 0)) goto LAB_00666e14;
manager = g_manager;
soundId = 0x99;
seed_fart_sound_override(&soundId);
fVar2 = 1.0;
}
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(soundId,1.0,2,0,fVar2,0.0);
}
LAB_00666e14:
manager = g_manager;
local_10 = *GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagHorn._h)) + 0x4)));
tearFlagsWord2 = GHIDRA_UINT((this->_tearFlags)._h);
if (((GHIDRA_UINT((this->_tearFlags)._l) & GHIDRA_UINT(g_tearFlagHorn._l)) != 0 ||
(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagHorn._l)) + 0x4)))) != 0) ||
((tearFlagsWord2 & GHIDRA_UINT(g_tearFlagHorn._h)) != 0 || local_10 != 0)) {
soundId = 0x364;
seed_fart_sound_override(&soundId);
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(soundId,1.0,2,0,1.0,0.0);
tearFlagsWord2 = GHIDRA_UINT((this->_tearFlags)._h);
}
local_10 = GHIDRA_UINT((this->_tearFlags)._l);
if (((local_10 & GHIDRA_UINT(g_tearFlagOrbit._l)) != 0 ||
(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagOrbit._l)) + 0x4)))) != 0) ||
((tearFlagsWord2 & GHIDRA_UINT(g_tearFlagOrbit._h)) != 0 ||
(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagOrbit._h)) + 0x4)))) != 0)) {
if (this->_fallingSpeed < 0.0) {
this->_fallingSpeed = this->_fallingSpeed * 3.0;
}
this->_isHovering = 1;
}
tearFlagsWord2 = GHIDRA_UINT((this->_tearFlags)._h);
if (((local_10 & GHIDRA_UINT(g_tearFlagHydrobounce._l)) == 0 &&
(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagHydrobounce._l)) + 0x4)))) == 0) &&
((tearFlagsWord2 & GHIDRA_UINT(g_tearFlagHydrobounce._h)) == 0 &&
(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagHydrobounce._h)) + 0x4)))) == 0)) {
if (((local_10 & GHIDRA_UINT(g_tearFlagBoomerang._l)) != 0 ||
(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagBoomerang._l)) + 0x4)))) != 0) ||
((tearFlagsWord2 & GHIDRA_UINT(g_tearFlagBoomerang._h)) != 0 ||
(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagBoomerang._h)) + 0x4)))) != 0)) {
this->_fallingSpeed = this->_fallingSpeed * 0.5;
this->_fallingAccel = (this->_fallingAccel + 0.08) * 0.25 - 0.08;
}
}
else {
this->_isHovering = 0;
this->_fallingSpeed = this->_fallingSpeed - 15.0;
this->_fallingAccel = this->_fallingAccel + 3.0;
}
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 8)) == 0x10) {
(this->_pos).y = (this->_pos).y - 4.0;
if ((0.0 < this->_fallingAccel) &&
(fVar2 = (this->_velocity).y, fVar2 < ABS((this->_velocity).x))) {
(this->_velocity).y = this->_fallingSpeed * 0.5 + fVar2;
}
fVar2 = (this->_velocity).x;
if (ABS((this->_velocity).y) < ABS(fVar2)) {
dirY = (this->_velocity).y;
fVar2 = sqrtf(dirY * dirY + fVar2 * fVar2);
if (0.0 < fVar2) {
dirY = (this->_velocity).y * (1.0 / fVar2);
}
if ((0.0 < dirY) && (dirY < 0.05)) {
(this->_velocity).y = 0.0;
}
}
}
return;
}
// 006670f0
void Entity_Tear::Update()
{
code *pcVar1;
BitSet128 flags;
BitSet128 flags_00;
BitSet128 flags_01;
BitSet128 flags_02;
BitSet128 tearFlags;
BitSet128 flags_03;
Vector pos;
qword qVar2;
undefined1 *puVar3;
byte bVar4;
char cVar5;
BitSet128 *pBVar6;
int iVar7;
BitSet128 *pBVar8;
TemporaryEffects *playerEffects;
Room *room;
Seeds *seeds;
Entity_Familiar *familiar;
Vector *pVVar9;
uint uVar10;
Entity *pEVar11;
EntityList *entityList;
int *piVar12;
undefined4 *puVar13;
EntityPtr EVar14;
Vector *pVVar15;
Entity_Laser *laser;
float *pfVar16;
Entity_Player *pEVar17;
uint uVar18;
Entity_Knife *knife;
char *_Str1;
AnimationState *animState;
Color *playerEffects;
EntityPtr *pEVar19;
undefined4 uVar20;
LayerState *layer;
byte *layerCount;
Entity_Effect *effect;
Sprite *sprite;
int tintedRockIdx;
PersistentGameData *persistentGameData;
GridEntity *gridEntity;
std_string *psVar21;
PlayerManager *playerManager;
RNG *laser;
TearParams *other;
TearParams *extraout_EAX;
Entity_Tear *spawnedTear;
Font *effect;
ANM2 *pAVar22;
byte *layerIndex;
float fVar23;
Vector *pVVar24;
bool bVar25;
float10 fVar26;
float fVar27;
EntityPtr EVar28;
EntityPtr EVar29;
Entity_Projectile *pEVar30;
undefined1 extraout_var [12];
undefined1 auVar31 [16];
undefined1 extraout_var_00 [12];
undefined1 extraout_var_01 [12];
undefined1 extraout_var_02 [12];
undefined1 extraout_var_03 [12];
undefined1 extraout_var_04 [12];
undefined1 extraout_var_05 [12];
undefined1 extraout_var_06 [12];
undefined1 extraout_var_07 [12];
undefined1 extraout_var_08 [12];
undefined1 extraout_var_09 [12];
undefined1 extraout_var_10 [12];
undefined1 auVar33 [12];
undefined1 extraout_var_11 [12];
undefined1 auVar32 [16];
undefined1 extraout_var_12 [12];
undefined1 extraout_var_13 [12];
undefined1 extraout_var_14 [12];
undefined1 extraout_var_15 [12];
undefined1 extraout_var_16 [12];
undefined1 extraout_var_17 [12];
undefined1 extraout_var_18 [12];
undefined1 extraout_var_19 [12];
undefined1 extraout_var_20 [12];
undefined1 extraout_var_21 [12];
undefined1 extraout_var_22 [12];
undefined1 extraout_var_23 [12];
undefined1 extraout_var_24 [12];
undefined1 extraout_var_25 [12];
undefined1 extraout_var_26 [12];
undefined1 extraout_var_27 [12];
void *pvVar34;
Color aCStackY_3c4c [128];
BitSet128 *pBVar35;
BitSet128 *pBVar36;
int variant;
Vector *in_stack_ffffd9fc;
TypeDescriptor *outResult;
undefined1 uVar37;
undefined1 uVar38;
undefined2 uVar39;
size_t _MaxCount;
EntityRef local_25e8;
EntityRef local_25c0;
EntityRef local_2598;
EntityRef local_2570;
BitSet128 notBounce;
BitSet128 notSplit;
BitSet128 notLudovico;
BitSet128 notBone;
BitSet128 notAbsorb;
BitSet128 notHydrobounce;
BitSet128 notFetus;
BitSet128 hydrobounceMask3;
BitSet128 quadsplitMask;
BitSet128 lasershotMask2;
BitSet128 poisonMask;
BitSet128 ludovicoMask6;
BitSet128 explosiveMask4;
BitSet128 andResult2;
BitSet128 orResult4;
BitSet128 withQuadsplit;
BitSet128 ludovicoMask5;
BitSet128 hydrobounceMask2;
BitSet128 hydrobounceMask;
BitSet128 ludovicoMask4;
BitSet128 notLasershot2;
BitSet128 explosiveMask3;
BitSet128 andResult;
BitSet128 tearFlagsCopy;
BitSet128 notResult;
BitSet128 orResult3;
BitSet128 orResult2;
BitSet128 orResult;
BitSet128 withOrbit;
BitSet128 lasershotMask;
BitSet128 notLaser;
BitSet128 laserMask;
BitSet128 explosiveMask2;
BitSet128 bit76Mask;
BitSet128 explosiveMask;
BitSet128 ludovicoMask3;
BitSet128 mysteriousLiquidCreepMask;
BitSet128 notWait;
BitSet128 waitMask;
BitSet128 notLasershot;
BitSet128 ludovicoMask2;
BitSet128 notDetonate;
BitSet128 detonateMask;
BitSet128 ludovicoMask25;
BitSet128 tractorBeamMask3;
BitSet128 ludovicoMask24;
BitSet128 continuumMask2;
BitSet128 explosiveMask6;
BitSet128 fetusMask5;
BitSet128 fetusMask4;
BitSet128 popMask2;
BitSet128 chainMask2;
BitSet128 ludovicoMask23;
BitSet128 bit125Mask2;
BitSet128 andResult33;
BitSet128 notBit126;
BitSet128 andResult32;
BitSet128 andResult31;
BitSet128 bit126Mask;
BitSet128 continuumMask;
BitSet128 ludovicoMask22;
BitSet128 boogerMask3;
BitSet128 orResult14;
BitSet128 withSpectral;
BitSet128 andResult30;
BitSet128 andResult29;
BitSet128 andResult28;
BitSet128 andResult27;
BitSet128 andResult26;
BitSet128 notQuadsplit2;
BitSet128 notSplit2;
BitSet128 notLudovico2;
BitSet128 notBone2;
BitSet128 notAbsorb3;
BitSet128 notHydrobounce2;
BitSet128 sporeMask4;
BitSet128 stickyMask4;
BitSet128 sporeMask3;
BitSet128 boogerMask2;
BitSet128 stickyMask3;
BitSet128 homingMask5;
BitSet128 notTurnHorizontal;
BitSet128 turnHorizontalMask2;
BitSet128 bit125Mask;
BitSet128 bit127Mask;
BitSet128 flatMask3;
BitSet128 ludovicoMask21;
BitSet128 andResult25;
BitSet128 notExplosive2;
BitSet128 occultMask2;
BitSet128 shrinkMask2;
BitSet128 growMask2;
BitSet128 orResult13;
BitSet128 andResult24;
BitSet128 notBounce2;
BitSet128 flatMask2;
BitSet128 ludovicoMask20;
BitSet128 withShrink3;
BitSet128 notTractorBeam;
BitSet128 spectralMask3;
BitSet128 sporeMask2;
BitSet128 boogerMask;
BitSet128 stickyMask2;
BitSet128 spectralMask2;
BitSet128 ludovicoMask19;
BitSet128 notRerollRockWisp;
BitSet128 rerollRockWispMask;
BitSet128 ludovicoMask18;
BitSet128 andResult23;
BitSet128 withBounceWallsonly;
BitSet128 hydrobounceMask6;
BitSet128 ludovicoMask17;
BitSet128 hydrobounceMask7;
BitSet128 ludovicoMask16;
BitSet128 popMask;
BitSet128 boomerangMask6;
BitSet128 ludovicoMask15;
BitSet128 tractorBeamMask2;
BitSet128 notChain;
BitSet128 chainMask;
BitSet128 andResult22;
BitSet128 tearFlagsCopy5;
BitSet128 andResult21;
BitSet128 tearFlagsCopy4;
BitSet128 notAbsorb2;
BitSet128 hydrobounceMask5;
BitSet128 notResult9;
BitSet128 orResult12;
BitSet128 orResult11;
BitSet128 orResult10;
BitSet128 withQuadsplit2;
BitSet128 quadsplitMask2;
BitSet128 splitMask;
BitSet128 andResult20;
BitSet128 withOrbitAdvanced2;
BitSet128 ludovicoMask14;
BitSet128 absorbMask;
BitSet128 andResult19;
BitSet128 orResult9;
BitSet128 withLudovico2;
BitSet128 accelerateMask;
BitSet128 andResult18;
BitSet128 orResult8;
BitSet128 withLudovico;
BitSet128 decelerateMask;
BitSet128 glowMask;
BitSet128 hydrobounceMask4;
BitSet128 ludovicoMask13;
BitSet128 boomerangMask5;
BitSet128 flatMask;
BitSet128 sporeMask;
BitSet128 stickyMask;
BitSet128 ludovicoMask12;
BitSet128 pulseMask;
BitSet128 attractorMask2;
BitSet128 bigSpiralMask;
BitSet128 spiralMask;
BitSet128 wiggleMask;
BitSet128 andResult17;
BitSet128 orResult7;
BitSet128 withOrbit2;
BitSet128 boomerangMask4;
BitSet128 ludovicoMask11;
BitSet128 spectralMask;
BitSet128 fetusMask3;
BitSet128 ludovicoMask10;
BitSet128 shrinkMask;
BitSet128 ludovicoMask9;
BitSet128 growMask;
BitSet128 homingMask4;
BitSet128 boomerangMask3;
BitSet128 boomerangMask2;
BitSet128 fetusMask2;
BitSet128 ludovicoMask8;
BitSet128 occultMask;
BitSet128 homingMask2;
BitSet128 turnHorizontalMask;
BitSet128 homingMask;
BitSet128 homingMask3;
BitSet128 andResult16;
BitSet128 tearFlagsCopy3;
BitSet128 notResult8;
BitSet128 withAbsorb;
BitSet128 andResult15;
BitSet128 tearFlagsCopy2;
BitSet128 notResult7;
BitSet128 orResult6;
BitSet128 withBooger;
BitSet128 andResult14;
BitSet128 notResult6;
BitSet128 withShrink5;
BitSet128 fetusTechMask2;
BitSet128 andResult11;
BitSet128 notResult3;
BitSet128 withShrink2;
BitSet128 fetusBoneMask;
BitSet128 andResult12;
BitSet128 notResult4;
BitSet128 ludovicoMask;
BitSet128 fetusKnifeMask;
BitSet128 andResult13;
BitSet128 notResult5;
BitSet128 withShrink4;
BitSet128 fetusTechMask;
BitSet128 fetusSwordMask;
BitSet128 notFetusTechx;
BitSet128 andResult10;
BitSet128 notResult2;
BitSet128 orResult5;
BitSet128 withShrink;
BitSet128 fetusTechxMask;
BitSet128 fetusMask;
BitSet128 explosiveMask5;
BitSet128 boomerangMask;
BitSet128 orbitAdvancedMask;
BitSet128 tractorBeamMask;
BitSet128 ludovicoMask7;
BitSet128 andResult9;
BitSet128 withOrbitAdvanced;
BitSet128 squareMask;
BitSet128 attractorMask;
BitSet128 laserMask2;
BitSet128 burstsplitMask;
BitSet128 notExplosive;
BitSet128 andResult8;
BitSet128 andResult7;
BitSet128 andResult6;
BitSet128 andResult5;
BitSet128 andResult4;
BitSet128 andResult3;
BitSet128 notQuadsplit;
Vector local_16d8;
Vector local_16d0;
Vector local_16c8;
Vector local_16c0;
Vector nextPos3;
Vector entityVel;
Vector local_16a8 [2];
Vector nextPos4;
Vector local_1690;
Vector local_1688;
Vector local_1680;
Vector entityPos5;
Vector local_1670;
Vector velPerpRight;
Vector VStack_1660;
Vector velPerpRight3;
Vector VStack_1650;
Vector velPerpRight2;
Vector VStack_1640;
Vector velPerpLeft2;
Vector VStack_1630;
Vector velPerpLeft;
Vector uniformScale4;
Vector local_1618;
Vector local_1610;
Vector randomDir;
Vector local_1600;
Vector local_15f8;
Vector local_15f0;
Vector local_15e8;
Vector uniformScale3;
Vector local_15d8;
Vector negated;
Vector local_15c8;
Vector local_15c0;
Vector local_15b8;
Vector VStack_15b0;
Vector VStack_15a8;
Vector VStack_15a0;
Vector local_1598;
Vector local_1590;
Vector local_1588;
undefined4 local_1580;
undefined4 uStack_157c;
undefined4 uStack_1578;
undefined4 uStack_1574;
BitSet128 bit126Flags;
BitSet128 bit125Flags;
Vector local_1550;
BitSet128 inheritedFlags;
Vector local_1538;
Vector nextPos2;
Vector local_1528;
Vector entityPos3;
Vector local_1518;
Vector local_1510;
Vector nextPos;
Vector local_1500;
Vector entityPos2;
Vector entityPos;
Vector local_14e8;
Vector uniformScale2;
Vector clampedPos2;
Vector local_14d0;
Vector uniformScale;
Vector clampedPos;
Vector local_14b8;
Vector entityPos25;
Vector parentPos10;
Vector local_14a0;
Vector clampedPos3;
Vector local_1490;
Vector local_1488;
Vector direction15;
Vector local_1478 [2];
Vector entityPos24;
Vector local_1460;
Vector local_1458;
Vector local_1450;
Vector stickTargetPos;
Vector stickTargetVel;
Vector local_1438;
Vector perpDir2;
Vector local_1428;
Vector local_1420;
Vector targetPos6;
Vector local_1410;
Vector local_1408;
Vector targetPos5;
Vector local_13f8;
Vector angleDir8;
Vector parentVel2;
Vector local_13e0;
Vector parentVel;
Vector lerped;
Vector local_13c8 [2];
Vector local_13b8;
Vector uniformScale13;
Vector spawnerPos;
Vector negated3;
Vector entityPos23;
Vector rotatedDir;
Vector local_1388;
Vector resized2;
Vector parentPos7;
Vector local_1370;
Vector direction14;
Vector local_1360;
Vector parentPos9;
Vector parentPos8;
Vector local_1348;
Vector direction13;
Vector randomDir5;
Vector entityPos22;
Vector local_1328;
Vector entityPos21;
Vector local_1318;
Vector local_1310;
Vector angleDir7;
Vector local_1300;
Vector randomDir4;
Vector parentPos6;
Vector parentPos5;
Vector local_12e0;
Vector local_12d8;
Vector local_12d0;
Vector cardinalDir;
Vector local_12c0;
Vector local_12b8;
Vector direction12;
Vector local_12a8;
Vector local_12a0;
Vector entityPos20;
Vector local_1290;
Vector local_1288;
Vector local_1280;
Vector entityVel4;
Vector local_1270;
Vector local_1268;
Vector entityVel3;
Vector entityPos19;
Vector local_1250;
Vector local_1248;
Vector entityPos18;
Vector local_1238;
Vector resized;
Vector entityPos17;
Vector parentPos4;
Vector entityPos16;
Vector local_1210;
Vector local_1208;
Vector angleDir6;
Vector entityPos15;
Vector local_11f0;
Vector local_11e8;
Vector uniformScale12;
Vector local_11d8;
Vector local_11d0;
Vector local_11c8;
Vector local_11c0;
Vector randomDir3;
Vector local_11b0;
Vector local_11a8;
Vector local_11a0;
Vector uniformScale11;
Vector local_1190;
Vector local_1188;
Vector local_1180;
Vector local_1178;
Vector randomDir2;
Vector local_1168;
Vector uniformScale10;
Vector local_1158;
Vector local_1150;
Vector local_1148;
Vector angleDir5;
Vector local_1138;
Vector local_1130;
Vector local_1128;
Vector local_1120;
Vector local_1118;
Vector local_1110;
Vector local_1108;
Vector direction11;
Vector local_10f8;
Vector local_10f0;
Vector local_10e8;
Vector local_10e0;
Vector local_10d8;
Vector parentPos3;
Vector parentPos2;
Vector parentPos;
Vector local_10b8 [2];
Vector local_10a8;
Vector local_10a0;
Vector entityPos14;
Vector local_1090;
Vector local_1088;
Vector direction4;
Vector targetPos;
Vector entityPos8;
Vector local_1068;
Vector local_1060;
Vector entityPos7;
Vector local_1050;
Vector local_1048;
Vector entityPos6;
Vector local_1038;
Vector local_1030;
Vector local_1028;
Vector local_1020;
Vector angleDir4;
Vector local_1010;
Vector angleDir3;
Vector negated2;
Vector local_ff8;
Vector local_ff0;
Vector direction10;
Vector direction9;
Vector direction8;
Vector direction7;
Vector targetPos4;
Vector entityPos13;
Vector local_fb8;
Vector local_fb0;
Vector entityPos12;
Vector local_fa0;
Vector local_f98;
Vector local_f90;
Vector entityPos11;
Vector direction6;
Vector local_f78;
Vector entityPos10;
Vector entityPos9;
Vector targetPos3;
Vector direction5;
Vector local_f50;
Vector targetPos2;
Vector local_f40;
Vector local_f38;
Vector local_f30;
Vector uniformScale5;
Vector local_f20;
Vector local_f18;
Vector local_f10;
Vector uniformScale7;
Vector uniformScale6;
Vector angleDir2;
Vector local_ef0;
Vector local_ee8;
Vector local_ee0;
Vector uniformScale9;
Vector uniformScale8;
Vector local_ec8;
Vector angleDir;
Vector local_eb8;
Vector local_eb0;
Vector local_ea8;
Vector local_ea0;
Vector local_e98;
Vector orbitDir;
Vector perpDir;
Vector direction3;
Vector direction2;
Vector local_e70;
Vector entityVel2;
Vector entityPos4;
Vector local_e58;
Vector local_e50;
Vector direction;
Vector local_e40;
BitSet128 inheritedFlags3;
BitSet128 inheritedFlags2;
GridEntityDesc local_e18;
Vector particlePos;
Vector otherPushedPos;
Vector pushedPos;
Vector otherBouncedVel;
Vector bouncedVel;
Vector fromTarget;
Vector local_dc8;
Vector fetusTechFacing;
Vector facingDir;
Vector nullOffset;
Vector local_da8;
Vector local_da0;
Vector toTechZeroTarget;
Vector wrapDelta;
Vector local_d88;
Vector roomClampedPos;
undefined1 radiusQuery200 [16];
undefined1 local_d68 [32];
undefined1 popTearQuery [16];
undefined1 radiusQuery [16];
undefined1 aheadQuery2 [16];
undefined1 fetusTechQuery [16];
undefined1 local_d08 [32];
Vector local_ce8;
Vector laserToTarget;
Vector local_cd8;
Vector particleDir;
Vector local_cc8;
Vector gridPos;
Vector local_cb8;
Vector local_cb0;
Vector local_ca8;
Vector local_ca0;
Vector local_c98;
Vector local_c90;
Vector local_c88;
undefined1 local_c80 [12];
undefined1 aheadQuery [16];
undefined1 deathmatchFamiliarQuery [16];
undefined1 techZeroQuery [16];
float local_c44;
void *timescaleFactor;
void *local_c3c;
float local_c38;
float fromTargetLenSq;
void *local_c30;
void *local_c2c;
float local_c28;
float local_c24;
void *local_c20;
float local_c1c;
float local_c18;
EntityList_EL local_c14;
EntityList_EL local_c04;
float local_bf4;
EntityList_EL local_bf0;
void *local_be0;
float local_bdc;
int local_bd8;
float local_bd4;
void *local_bd0;
float local_bcc;
float local_bc8;
float local_bc4;
void *local_bc0;
float local_bbc;
float local_bb8;
float local_bb4;
float local_bb0;
float local_bac;
float local_ba8;
float local_ba4;
float local_ba0;
undefined4 uStack_b9c;
float local_b98;
Vector prevPos;
Vector local_b8c;
Vector fetusTechAimDir;
Vector local_b7c;
Vector local_b74;
Vector local_b6c;
Vector local_b64;
Vector local_b5c;
Vector shotVelocity;
float redCreepTearScale;
float redCreepBaseScale;
float local_b44;
float greenCreepTearScale;
float greenCreepBaseScale;
float relSpeed;
undefined4 local_b34;
undefined4 local_b30;
float local_b2c;
undefined4 local_b28;
undefined4 local_b24;
float local_b20;
float local_b1c;
float local_b18;
undefined4 local_b14;
float local_b10;
undefined1 *local_b0c;
float local_b08;
undefined4 local_b04;
undefined4 local_b00;
float local_afc;
EntityPtr local_af8;
float local_af4;
float local_af0;
float otherRelSpeed;
float local_ae8;
float local_ae4;
float local_ae0;
undefined4 local_adc;
undefined4 local_ad8;
float local_ad4;
float local_ad0;
float local_acc;
undefined4 local_ac8;
undefined4 local_ac4;
float local_ac0;
undefined4 local_abc;
float local_ab8;
undefined4 local_ab4;
float local_ab0;
float local_aac;
undefined4 local_aa8;
undefined4 local_aa4;
int local_aa0;
undefined4 local_a9c;
float local_a98;
undefined4 local_a94;
float local_a90;
float local_a8c;
undefined4 local_a88;
float local_a84;
undefined4 local_a80;
EntityPtr local_a7c;
undefined4 local_a78;
EntityPtr local_a74;
undefined4 local_a70;
float local_a6c;
float local_a68;
float local_a64;
float local_a60;
undefined4 local_a5c;
float local_a58;
float local_a54;
float local_a50;
float local_a4c;
float local_a48;
float local_a44;
float local_a40;
undefined4 local_a3c;
float local_a38;
undefined4 local_a34;
float local_a30;
float local_a2c;
float local_a28;
undefined1 *local_a24;
float bloodParticleScale;
float bloodParticleDist;
undefined4 minBloodParticles;
float poofScaleSmall;
float poofScaleLarge;
float poofSizeScale;
float tearSpeed;
float defaultSplitSpeed;
undefined4 local_a00;
float local_9fc;
float local_9f8;
undefined4 local_9f4;
float particleSpeed;
float particleDist;
undefined4 uStack_9e8;
int particleCount;
undefined1 local_9e0 [12];
Vector wrappedPos;
Vector local_9cc;
Vector local_9c4;
Vector local_9bc;
Vector separation;
Vector quadsplitVel;
Vector splitVel;
Vector redCreepPos;
Vector greenCreepPos;
Vector local_98c;
Vector local_984;
float local_97c;
EntityPtr local_978;
float halfOverlap;
float bounceFactor;
undefined1 *local_96c;
float local_968;
Vector separationDir;
float local_95c;
Vector velDir;
Vector local_950;
float local_948;
Entity *chainChild;
float local_940;
float local_93c;
float local_938;
Vector fromTarget2;
float local_92c;
float local_928;
float local_924;
int bloodParticleCount;
Vector aimDir;
float local_914;
float local_910;
float squareSpeedScale;
BitSet128 *tearFlagsPtr;
EntityPtr local_904;
float local_900;
EntityPtr local_8fc;
EntityPtr local_8f8;
Entity_Player *local_8f4;
float pointSixConst;
float local_8ec;
Vector *tearPos;
EntityPtr local_8e4;
Entity_Player *local_8e0;
float local_8dc;
EntityPtr local_8d8;
float pointThreeConst;
EntityPtr local_8d0;
EntityPtr local_8cc;
ANM2 *local_8c8;
BitSet128 *local_8c4;
EntityPtr local_8c0;
char local_8b9;
float halfConst;
EntityPtr local_8b4;
EntityPtr local_8b0;
EntityPtr local_8ac;
float oneConst;
byte local_8a1;
EntityPtr local_8a0;
EntityPtr local_89c;
EntityPtr local_898;
float zeroConst;
EntityPtr local_890;
EntityPtr local_88c;
EntityPtr local_888;
Entity_Tear *tear;
float local_880;
EntityPtr local_87c;
TearParams local_878;
TearParams local_810 [9];
ColorMod local_514;
Color local_4e8 [4];
Color local_438 [4];
Color aCStack_388 [4];
TearParams tearHitParams;
TearParams TStack_270;
undefined1 local_1d8 [68];
std_string curAnimName;
Color splashColor;
undefined1 local_150 [44];
Color CStack_124;
TearParams local_f8;
RNG local_8c;
undefined1 local_7c [88];
uint stackCookie;
undefined1 *puStack_20;
void *prevExceptionList;
undefined1 *puStack_18;
undefined4 ehState;
ColorMod *color;
float decayFactor;
Game *game;
puStack_20 = local_7c + 0x78;
ehState = 0xffffffff;
puStack_18 = &LAB_00af78c4;
prevExceptionList = ExceptionList;
stackCookie = __security_cookie ^ GHIDRA_UINT((local_7c + 0x6c));
ExceptionList = &prevExceptionList;
local_87c = (EntityPtr)0x0;
local_8f8 = (EntityPtr)0x0;
tear = this;
puVar3 = local_7c + 0x78;
if (this->_isFireSoundPending != 0) {
play_fire_sound();
this->_isFireSoundPending = 0;
puVar3 = puStack_20;
}
puStack_20 = puVar3;
tearFlagsPtr = &this->_tearFlags;
pBVar6 = BitSet128::operator_and(&ludovicoMask,tearFlagsPtr,&g_tearFlagLudovico);
if ((((GHIDRA_INT(pBVar6->_l) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar6->_l) + 4)) != 0) ||
(GHIDRA_INT(pBVar6->_h) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar6->_h) + 4)) != 0)) && ((this->_subtype & 4) != 0)
) && (this->_parent == (EntityPtr)0x0)) goto LAB_006684e5;
EVar14 = this->_spawnerEntity;
local_8d8 = (EntityPtr)this;
if (this->_spawnerEntity != (EntityPtr)0x0) {
do {
local_8d8 = EVar14;
EVar14 = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(local_8d8) + 0x3c8));
} while (*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(local_8d8) + 0x3c8)) != (EntityPtr)0x0);
}
pVVar9 = &this->_pos;
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_8d8) + 0x28)) != 1) {
local_8d8 = (EntityPtr)0x0;
}
tearPos = pVVar9;
fVar27 = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::GetTimeScale(pVVar9,GHIDRA_CAST<Entity *>(this));
game = g_game;
local_8d0 = (EntityPtr)&this->_speedMultiplier;
local_8ec = 0.75;
*GHIDRA_CAST<float *>(local_8d0) = fVar27;
if (0 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 0x722c))) {
*GHIDRA_CAST<float *>(local_8d0) = fVar27 * 0.75;
}
if (0 < this->_holdTimer) {
iVar7 = this->_holdTimer + -1;
this->_holdTimer = iVar7;
if (iVar7 != 0) {
EVar14 = this->_parent;
if (EVar14 != (EntityPtr)0x0) {
fVar27 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x340));
fVar23 = (this->_holdOffset).y;
pVVar9->x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x33c)) + (this->_holdOffset).x;
(this->_pos).y = fVar27 + fVar23;
}
(this->_velocity).x = g_vectorZero.x;
(this->_velocity).y = g_vectorZero.y;
if ((this->_holdTimer / 0xf & 1U) == 0) {
fVar27 = this->_height + 0.5;
}
else {
fVar27 = this->_height - 0.5;
}
this->_height = fVar27;
(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(this))))->Entity_Projectile::SetHeight(fVar27);
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::Update();
ExceptionList = prevExceptionList;
return;
}
(this->_velocity).x = (this->_holdVelocity).x;
(this->_velocity).y = (this->_holdVelocity).y;
}
pBVar6 = &this->_tearFlags;
pBVar8 = BitSet128::operator_and(&detonateMask,pBVar6,&g_tearFlagDetonate);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar8)))->BitSet128::IsNonZero();
local_890 = (EntityPtr)0x40400000;
if ((bVar4 != 0) && (local_8d8 != (EntityPtr)0x0)) {
playerEffects = GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(local_8d8))))->Entity_Player)::GetEffects();
bVar4 = (GHIDRA_CAST<TemporaryEffects *>((playerEffects)))->TemporaryEffects::HasCollectibleEffect(0x89);
if (bVar4 != 0) {
(GHIDRA_CAST<BitSet128 *>((&g_tearFlagDetonate)))->BitSet128::__bnot(&notDetonate);
FUN_005cd430();
(GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::operator__(&g_tearFlagExplosive);
this->SetCollisionDamage();
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::Die();
this->_deathFlags = 0x40;
}
}
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
bVar4 = (GHIDRA_CAST<Room *>((room)))->Room::is_type_16();
pointSixConst = 0.6;
if (((bVar4 != 0) && (-5.1 <= this->_height)) && (this->_tearRange * 0.6 < this->_updateTime)) {
pBVar8 = BitSet128::operator_and(&ludovicoMask2,pBVar6,&g_tearFlagLudovico);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar8)))->BitSet128::IsZero();
if (bVar4 != 0) {
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::Die();
this->_deathFlags = 0x40;
}
}
if ((this->_variant == 0xd) || (this->_variant == 0x17)) {
seeds = GHIDRA_CAST<Seeds *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetSeeds();
bVar4 = (GHIDRA_CAST<Seeds *>((seeds)))->Seeds::HasSeedEffect(0x4f);
if (bVar4 != 0) {
(GHIDRA_CAST<BitSet128 *>((&g_tearFlagLasershot)))->BitSet128::__bnot(&notLasershot);
FUN_005cd430();
}
}
local_8dc = 1.0;
oneConst = local_8dc;
pBVar6 = BitSet128::operator_and(&waitMask,pBVar6,&g_tearFlagWait);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
halfConst = 0.5;
if (bVar4 == 0) {
if (0 < this->_waitFrames) {
if (this->_parent != (EntityPtr)0x0) {
iVar7 = (GHIDRA_CAST<Entity *>(()))->Entity::Type();
EVar14 = this->_parent;
if (iVar7 != 1) {
iVar7 = (GHIDRA_CAST<Entity *>(()))->Entity::Type();
if (iVar7 != 3) goto LAB_0066757c;
familiar = GHIDRA_CAST<Entity_Familiar *>(FUN_00435de0());
EVar14 = (EntityPtr)(GHIDRA_CAST<Entity_Familiar *>((familiar)))->Entity_Familiar::Player();
}
pEVar17 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::ToPlayer();
if ((pEVar17 != GHIDRA_CAST<Entity_Player *>(0x0)) &&
(iVar7 = (GHIDRA_CAST<Entity_Player *>((pEVar17)))->Entity_Player::GetFireDirection(), iVar7 == -1)) {
this->_waitFrames = 1;
}
}
LAB_0066757c:
piVar12 = &this->_waitFrames;
*piVar12 = *piVar12 + -1;
iVar7 = this->_waitFrames;
if (*piVar12 == 0) {
(GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::operator_add_assign(&this->_continueVelocity);
(GHIDRA_CAST<Vector *>((&this->_continueVelocity)))->Vector::operator_assign(&g_vectorZero);
iVar7 = this->_waitFrames;
}
if ((iVar7 / 0xf & 1U) == 0) {
fVar27 = this->_height + halfConst;
}
else {
fVar27 = this->_height - halfConst;
}
this->_height = fVar27;
(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(this))))->Entity_Projectile::SetHeight(fVar27);
}
}
else {
this->_waitFrames = 0x5a;
(GHIDRA_CAST<BitSet128 *>((&g_tearFlagWait)))->BitSet128::__bnot(&notWait);
FUN_005cd430();
(GHIDRA_CAST<Vector *>((&this->_continueVelocity)))->Vector::operator_assign(&this->_velocity);
(GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::operator_assign(&g_vectorZero);
}
pBVar6 = &this->_tearFlags;
pBVar8 = BitSet128::operator_and
(&mysteriousLiquidCreepMask,pBVar6,&g_tearFlagMysteriousLiquidCreep);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar8)))->BitSet128::IsNonZero();
local_8fc = (EntityPtr)0x41700000;
local_900 = 0.4;
if (bVar4 != 0) {
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_888)) + 0x0))) = this->_dead != 0;
pBVar8 = BitSet128::operator_and(&ludovicoMask3,pBVar6,&g_tearFlagLudovico);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar8)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(5,this->_index);
local_888 = (EntityPtr)(GHIDRA_UINT(local_888) & 0xff);
if (bVar4 != 0) {
local_888 = (EntityPtr)0x1;
}
}
if (this->_dead != 0) {
pBVar8 = BitSet128::operator_and(&explosiveMask,pBVar6,&g_tearFlagExplosive);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar8)))->BitSet128::IsNonZero();
if ((bVar4 != 0) || (this->_variant == 4)) goto LAB_006677ce;
}
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_888)) + 0x0))) != '\0') {
greenCreepPos.y = (this->_pos).y;
greenCreepPos.x = (this->_pos).x;
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
pVVar9 = (GHIDRA_CAST<Room *>((room)))->Room::GetClampedPosition(&clampedPos,&greenCreepPos,15.0);
(GHIDRA_CAST<Vector *>((&greenCreepPos)))->Vector::operator_assign(pVVar9);
uVar10 = Random();
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0x0);
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x35,&greenCreepPos,&g_vectorZero,GHIDRA_CAST<Entity *>(this->_spawnerEntity),0,
uVar10);
pEVar11 = GHIDRA_CAST<Entity *>(__RTDynamicCast());
greenCreepBaseScale = 0.4;
pVVar9 = (GHIDRA_CAST<Vector *>((&g_vectorOne)))->Vector::__mul(&uniformScale,&greenCreepBaseScale);
fVar26 = (float10)Scale(tear);
greenCreepTearScale = (float)fVar26;
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__mul(&local_14d0,&greenCreepTearScale);
(GHIDRA_CAST<Entity *>((pEVar11)))->Entity::SetSpriteScale(pVVar9);
pEVar11->Update();
pBVar6 = tearFlagsPtr;
this = tear;
}
}
LAB_006677ce:
pBVar8 = BitSet128::operator_and(&bit76Mask,pBVar6,GHIDRA_CAST<BitSet128 *>(&DAT_00c346a0));
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar8)))->BitSet128::IsNonZero();
if ((bVar4 != 0) && (this->_dead != 0)) {
pBVar8 = BitSet128::operator_and(&explosiveMask2,pBVar6,&g_tearFlagExplosive);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar8)))->BitSet128::IsNonZero();
if ((bVar4 == 0) && (this->_variant != 4)) {
redCreepPos.y = (this->_pos).y;
redCreepPos.x = (this->_pos).x;
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
pVVar9 = (GHIDRA_CAST<Room *>((room)))->Room::GetClampedPosition(&clampedPos2,&redCreepPos,15.0);
(GHIDRA_CAST<Vector *>((&redCreepPos)))->Vector::operator_assign(pVVar9);
uVar10 = Random();
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0x0);
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x2e,&redCreepPos,&g_vectorZero,GHIDRA_CAST<Entity *>(this->_spawnerEntity),0,
uVar10);
pEVar11 = GHIDRA_CAST<Entity *>(__RTDynamicCast());
redCreepBaseScale = 0.4;
pVVar9 = (GHIDRA_CAST<Vector *>((&g_vectorOne)))->Vector::__mul(&uniformScale2,&redCreepBaseScale);
fVar26 = (float10)Scale(tear);
redCreepTearScale = (float)fVar26;
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__mul(&local_14e8,&redCreepTearScale);
(GHIDRA_CAST<Entity *>((pEVar11)))->Entity::SetSpriteScale(pVVar9);
pEVar11->Update();
pBVar6 = tearFlagsPtr;
}
}
pBVar6 = BitSet128::operator_and(&laserMask,pBVar6,&g_tearFlagLaser);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
this = tear;
zeroConst = 0.0;
pointThreeConst = 0.3;
if (bVar4 != 0) {
local_8b9 = '\0';
if (tear->_techZeroTarget == (EntityPtr)0x0) {
local_8a0 = (EntityPtr)0x0;
local_8b0 = (EntityPtr)0x47fd2000;
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0x6679c9);
EntityList::QueryRadius(entityList,GHIDRA_CAST<EntityList_EL *>(techZeroQuery),&this->_pos,350.0,4);
ehState = 0;
local_898 = (EntityPtr)0x0;
iVar7 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(techZeroQuery))))->EntityList::Size();
if (iVar7 != 0) {
do {
piVar12 = GHIDRA_CAST<int *>(std)::vector<int>::operator_index();
if (GHIDRA_CAST<Entity_Tear *>(*piVar12) != this) {
puVar13 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
iVar7 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar13))))->Entity::Type();
if (iVar7 == 2) {
std::vector<int>::operator_index();
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0x0);
local_904 = (EntityPtr)__RTDynamicCast();
pVVar9 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_904))))->Entity::Position(&entityPos);
local_8e4 = (EntityPtr)(GHIDRA_CAST<Vector *>((pVVar9)))->Vector::DistanceSquared(&this->_pos);
if ((float)local_8e4 < (float)local_8b0) {
local_8a0 = local_904;
local_8b0 = local_8e4;
}
}
}
local_898 = (EntityPtr)(GHIDRA_INT(local_898) + 1);
EVar14 = (EntityPtr)(GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(techZeroQuery))))->EntityList::Size();
} while (GHIDRA_UINT(local_898) < GHIDRA_UINT(EVar14));
if (((local_8a0 != (EntityPtr)0x0) && (*GHIDRA_CAST<Entity_Tear **>((GHIDRA_CAST<char *>(local_8a0) + 0x48c)) != this))
&& (local_8d8 != (EntityPtr)0x0)) {
pVVar9 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_8a0))))->Entity::Position(&entityPos2);
pVVar15 = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_8a0))))->Entity)::PositionOffset();
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__add(&local_1500,pVVar15);
pVVar15 = (GHIDRA_CAST<Vector *>((&this->_pos)))->Vector::__add(&nextPos,&this->_velocity);
pVVar15 = (GHIDRA_CAST<Vector *>((pVVar15)))->Vector::__add(&local_1510,&this->_posOffset);
(GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__sub(&toTechZeroTarget,pVVar15);
if (this->_techZeroLaser == (EntityPtr)0x0) {
pVVar9 = (GHIDRA_CAST<Vector *>((&local_1518)))->Vector::Vector(zeroConst,-15.0);
local_8e4 = (EntityPtr)(GHIDRA_CAST<Vector *>((&toTechZeroTarget)))->Vector::GetAngleDegrees();
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0x3);
laser = Entity_Laser::ShootAngle
(10,&this->_pos,(float)local_8e4,3,pVVar9,GHIDRA_CAST<Entity *>(local_8d8),1);
if (laser == GHIDRA_CAST<Entity_Laser *>(0x0)) {
(GHIDRA_CAST<BitSet128 *>((&g_tearFlagLaser)))->BitSet128::__bnot(&notLaser);
FUN_005cd430();
local_8b9 = '\0';
(GHIDRA_CAST<EntityPtr *>((&this->_techZeroTarget)))->EntityPtr::SetReference(GHIDRA_CAST<Entity *>(0x0));
goto LAB_00667cb7;
}
pEVar11 = GHIDRA_CAST<Entity *>(0x0);
iVar7 = Isaac::Random(2);
Entity_Player::GetTearHitParams
(GHIDRA_CAST<Entity_Player *>(local_8d8),&TStack_270,3,1.0,iVar7 * 2 + -1,pEVar11);
(**(code **)(*GHIDRA_CAST<int *>(laser) + 0x40))();
(GHIDRA_CAST<Entity_Laser *>((laser)))->Entity_Laser::set_scale(TStack_270._tearScale);
FUN_00435cd0();
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(g_tearFlagSpectral._l);
FUN_00456830();
set_field_0x37c();
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(laser))))->Entity::SetParent(GHIDRA_CAST<Entity *>(this));
FUN_00435f70();
(GHIDRA_CAST<EntityPtr *>((&this->_techZeroLaser)))->EntityPtr::SetReference(GHIDRA_CAST<Entity *>(laser));
local_8b9 = '\x01';
}
(GHIDRA_CAST<EntityPtr *>((&this->_techZeroTarget)))->EntityPtr::SetReference(GHIDRA_CAST<Entity *>(local_8a0));
}
}
LAB_00667cb7:
ehState = 0xffffffff;
(GHIDRA_CAST<EntityList_Query *>((techZeroQuery)))->EntityList_Query::~EntityList_Query();
}
pEVar19 = &this->_techZeroTarget;
local_8e4 = (EntityPtr)&this->_techZeroLaser;
if ((this->_techZeroLaser != (EntityPtr)0x0) &&
(((this->_dead != 0 || (*pEVar19 == (EntityPtr)0x0)) ||
(cVar5 = (GHIDRA_CAST<Entity *>(()))->Entity::IsDead(), cVar5 != '\0')))) {
(**(code **)(*GHIDRA_CAST<int *>(this->_techZeroLaser) + 0x28))();
(GHIDRA_CAST<EntityPtr *>((&this->_techZeroLaser)))->EntityPtr::SetReference(GHIDRA_CAST<Entity *>(0x0));
(GHIDRA_CAST<EntityPtr *>((pEVar19)))->EntityPtr::SetReference(GHIDRA_CAST<Entity *>(0x0));
}
if ((((this->_dead != 0) ||
((*pEVar19 != (EntityPtr)0x0 && (cVar5 = (GHIDRA_CAST<Entity *>(()))->Entity::IsDead(), cVar5 != '\0')))) ||
(*pEVar19 == (EntityPtr)0x0)) && (this->_techZeroLaser != (EntityPtr)0x0)) {
(**(code **)(*GHIDRA_CAST<int *>(this->_techZeroLaser) + 0x28))();
}
if ((this->_techZeroLaser != (EntityPtr)0x0) && (*pEVar19 != (EntityPtr)0x0)) {
pVVar9 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*pEVar19))))->Entity::Position(&entityPos3);
pVVar15 = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this->_techZeroTarget))))->Entity)::PositionOffset();
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__add(&local_1528,pVVar15);
pVVar15 = (GHIDRA_CAST<Vector *>((&this->_pos)))->Vector::__add(&nextPos2,&this->_velocity);
pVVar15 = (GHIDRA_CAST<Vector *>((pVVar15)))->Vector::__add(&local_1538,&this->_posOffset);
(GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__sub(&laserToTarget,pVVar15);
local_89c = (EntityPtr)(GHIDRA_CAST<Vector *>((&laserToTarget)))->Vector::Length();
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0x0);
EVar14 = (EntityPtr)__RTDynamicCast();
local_8b0 = EVar14;
fVar27 = (GHIDRA_CAST<Vector *>((&laserToTarget)))->Vector::GetAngleDegrees();
(GHIDRA_CAST<Entity_NPC *>((GHIDRA_CAST<Entity_NPC *>(EVar14))))->Entity_NPC::SetAimAngle(fVar27);
(GHIDRA_CAST<Entity_Laser *>((GHIDRA_CAST<Entity_Laser *>(EVar14))))->Entity_Laser::SetMaxDistance((float)local_89c);
(GHIDRA_CAST<Entity_Laser *>((GHIDRA_CAST<Entity_Laser *>(EVar14))))->Entity_Laser::SetTimeout();
pVVar9 = (GHIDRA_CAST<Vector *>((tearPos)))->Vector::__add(&local_1550,&this->_posOffset);
this = tear;
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__add(&local_1588,&tear->_velocity);
pVVar15 = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_8b0))))->Entity)::PositionOffset();
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__sub(&local_1590,pVVar15);
EVar14 = local_8b0;
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_8b0))))->Entity::SetPosition(pVVar9);
if (350.0 < (float)local_89c) {
(**(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x28))();
}
if (local_8b9 != '\0') {
(**(code **)(*GHIDRA_CAST<int *>(EVar14) + 0xc))();
}
}
}
pBVar6 = BitSet128::operator_and(&lasershotMask,&this->_tearFlags,&g_tearFlagLasershot);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
local_8f4 = GHIDRA_CAST<Entity_Player *>(0x41f00000);
if (bVar4 == 0) {
if (this->_laserShotLaser == (EntityPtr)0x0) goto LAB_00668237;
this->_visible = 1;
this->_entityCollisionClass = 4;
(**(code **)(*GHIDRA_CAST<int *>(this->_laserShotLaser) + 0x28))();
LAB_00668224:
(GHIDRA_CAST<EntityPtr *>((&this->_laserShotLaser)))->EntityPtr::SetReference(GHIDRA_CAST<Entity *>(0x0));
}
else {
pVVar9 = &this->_continueVelocity;
if (this->_waitFrames < 1) {
pVVar9 = &this->_velocity;
}
shotVelocity.x = pVVar9->x;
shotVelocity.y = pVVar9->y;
if (this->_laserShotLaser == (EntityPtr)0x0) {
local_8b0 = local_8d8;
if (local_8d8 == (EntityPtr)0x0) {
local_8b0 = (EntityPtr)(GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(0);
}
(GHIDRA_CAST<Vector *>((&this->_pos)))->Vector::operator__(&this->_velocity);
pVVar9 = (GHIDRA_CAST<Vector *>((&local_1598)))->Vector::Vector(zeroConst,this->_height);
local_8e4 = (EntityPtr)(GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::GetAngleDegrees();
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0x3e8);
EVar14 = (EntityPtr)
Entity_Laser::ShootAngle
(3,&this->_pos,(float)local_8e4,1000,pVVar9,GHIDRA_CAST<Entity *>(local_8b0),1);
local_888 = EVar14;
if (EVar14 != (EntityPtr)0x0) {
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::SetParent(GHIDRA_CAST<Entity *>(this));
(GHIDRA_CAST<Entity_Laser *>((GHIDRA_CAST<Entity_Laser *>(EVar14))))->Entity_Laser::SetMaxDistance(30.0);
(**(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x40))();
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x3c);
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::GetColor();
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0xff);
(*pcVar1)();
pBVar36 = &g_tearFlagContinuum;
pBVar35 = &g_tearFlagSplit;
pBVar8 = &g_tearFlagHydrobounce;
pBVar6 = BitSet128::operator_or(&withOrbit,&g_tearFlagBounce,&g_tearFlagOrbit);
pBVar6 = BitSet128::operator_or(&orResult,pBVar6,pBVar8);
pBVar6 = BitSet128::operator_or(&orResult2,pBVar6,pBVar35);
pBVar6 = BitSet128::operator_or(&orResult3,pBVar6,pBVar36);
pBVar6 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::__bnot(&notResult);
pBVar8 = TearFlags(this,&tearFlagsCopy);
BitSet128::operator_and(&andResult,pBVar8,pBVar6);
EVar14 = local_888;
FUN_00456830();
(GHIDRA_CAST<Entity_Laser *>((GHIDRA_CAST<Entity_Laser *>(EVar14))))->Entity_Laser::set_disable_init_sound();
(GHIDRA_CAST<Entity_Laser *>((GHIDRA_CAST<Entity_Laser *>(EVar14))))->Entity_Laser::SetMultidimensionalTouched();
FUN_005cd5a0();
fVar27 = (GHIDRA_CAST<Vector *>((&shotVelocity)))->Vector::GetAngleDegrees();
(GHIDRA_CAST<Entity_NPC *>((GHIDRA_CAST<Entity_NPC *>(EVar14))))->Entity_NPC::SetAimAngle(fVar27);
(**(code **)(*GHIDRA_CAST<int *>(EVar14) + 0xc))();
(GHIDRA_CAST<EntityPtr *>((&this->_laserShotLaser)))->EntityPtr::SetReference(GHIDRA_CAST<Entity *>(EVar14));
this->_visible = 0;
pBVar6 = BitSet128::operator_and(&explosiveMask3,&this->_tearFlags,&g_tearFlagExplosive);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsZero();
if (bVar4 != 0) {
this->_entityCollisionClass = 0;
}
goto LAB_00668180;
}
(GHIDRA_CAST<BitSet128 *>((&g_tearFlagLasershot)))->BitSet128::__bnot(&notLasershot2);
FUN_005cd430();
this->_visible = 1;
this->_entityCollisionClass = 4;
}
else {
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0x0);
EVar14 = (EntityPtr)__RTDynamicCast();
if (EVar14 != (EntityPtr)0x0) {
LAB_00668180:
local_8e4 = (EntityPtr)(GHIDRA_CAST<Vector *>((&shotVelocity)))->Vector::GetAngleDegrees();
fVar26 = (float10)(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(EVar14))))->Entity_Projectile::Damage();
local_904 = (EntityPtr)(float)fVar26;
fVar27 = LerpAngleDeg((float)local_904,(float)local_8e4,halfConst);
(GHIDRA_CAST<Entity_NPC *>((GHIDRA_CAST<Entity_NPC *>(EVar14))))->Entity_NPC::SetAimAngle(fVar27);
if (this->_dead != 0) {
iVar7 = FUN_00579760();
if (10 < iVar7) {
(GHIDRA_CAST<Entity_Laser *>((GHIDRA_CAST<Entity_Laser *>(EVar14))))->Entity_Laser::SetTimeout();
}
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::SetVelocity(&this->_velocity);
goto LAB_00668224;
}
(GHIDRA_CAST<Entity_Laser *>((GHIDRA_CAST<Entity_Laser *>(EVar14))))->Entity_Laser::SetTimeout();
}
}
}
LAB_00668237:
pVVar9 = &this->_pos;
pEVar17 = GHIDRA_CAST<Entity_Player *>(this->_fallingSpeed);
local_8e0 = pEVar17;
pBVar6 = BitSet128::operator_and(&ludovicoMask4,&this->_tearFlags,&g_tearFlagLudovico);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
pBVar6 = BitSet128::operator_and(&hydrobounceMask,&this->_tearFlags,&g_tearFlagHydrobounce);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::GetRootParent();
local_888 = (EntityPtr)(3.1415927 / (float)pEVar17);
iVar7 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::FrameCount();
local_8b0 = (EntityPtr)sinf_wrapper((float)(iVar7 + -1) * (float)local_888);
iVar7 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::FrameCount();
fVar27 = sinf_wrapper((float)iVar7 * (float)local_888);
Math::abs();
(this->_posOffset).y = fVar27 * this->_height;
EVar14 = local_8b0;
Math::abs();
local_8e0 = GHIDRA_CAST<Entity_Player *>(((this->_posOffset).y - (float)EVar14 * this->_height));
iVar7 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::FrameCount();
fVar27 = sinf_wrapper((float)iVar7 * (float)local_888);
if (fVar27 * (float)local_8b0 < zeroConst) {
this->_deathFlags = 4;
this->_dead = 1;
apply_death_flag_effects(this,GHIDRA_CAST<Entity *>(0x0));
}
}
}
local_8e4 = (EntityPtr)0xc1200000;
local_8cc = (EntityPtr)0xc1a00000;
local_904 = (EntityPtr)0x3e800000;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) = ZEXT812(0xc1be0000);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0xc))) = 0;
local_8b0 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0)));
if ((this->_dead == 0) || (this->_variant == 9)) goto LAB_0066a370;
if (this->_variant == 0x28) {
rng_pair_init(&local_e18);
local_e18._type = GHIDRA_UINT(this->_subtype) >> 0x10;
local_e18._variant = this->_subtype & 0xffff;
local_e18._spawnSeed = this->_initSeed;
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::HasEntityFlags(0x40000);
local_e18._varData = GHIDRA_INT((bVar4 != 0));
local_e18._state = GHIDRA_INT(this->_health);
Entity::DestroyRockGridAt(pVVar9,&local_e18,GHIDRA_CAST<Entity *>(this),this->_tearIdx);
if (this->_spawnerEntity != (EntityPtr)0x0) {
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this->_spawnerEntity))))->Entity::is_player();
if (bVar4 != 0) {
local_904 = (EntityPtr)(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this->_spawnerEntity))))->Entity::ToPlayer();
if (local_904 != (EntityPtr)0x0) {
bVar4 = (GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(local_904))))->Entity_Player::HasCollectible(0x248,0);
if (bVar4 != 0) {
iVar7 = Isaac::Random(3);
EVar14 = (EntityPtr)(iVar7 + 1);
local_8e4 = EVar14;
if (0 < GHIDRA_INT(EVar14)) {
do {
local_8e4 = (EntityPtr)
Entity_Player::AddWisp(GHIDRA_CAST<Entity_Player *>(local_904),0x25c,pVVar9,0,1);
if (local_8e4 != (EntityPtr)0x0) {
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_8e4))))->Entity::SetTargetPosition(*pVVar9);
(**(code **)(GHIDRA_INT(*GHIDRA_CAST<float *>(local_8e4)) + 0xc))();
}
EVar14 = (EntityPtr)(GHIDRA_INT(EVar14) + -1);
} while (EVar14 != (EntityPtr)0x0);
this = tear;
}
}
}
}
}
LAB_006684e5:
this->Remove();
ExceptionList = prevExceptionList;
return;
}
local_888 = (EntityPtr)(GHIDRA_UINT(local_888) & 0xffffff00);
pBVar6 = BitSet128::operator_and(&hydrobounceMask2,&this->_tearFlags,&g_tearFlagHydrobounce);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if ((bVar4 != 0) && (this->_deathFlags == 4)) {
pBVar6 = BitSet128::operator_and(&ludovicoMask5,&this->_tearFlags,&g_tearFlagLudovico);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
local_8c0 = local_8e4;
if (bVar4 == 0) {
pBVar8 = &g_tearFlagBurstsplit;
pBVar6 = BitSet128::operator_or(&withQuadsplit,&g_tearFlagExplosive,&g_tearFlagQuadsplit);
pBVar6 = BitSet128::operator_or(&orResult4,pBVar6,pBVar8);
pBVar6 = BitSet128::operator_and(&andResult2,&this->_tearFlags,pBVar6);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 == 0) {
EVar14 = local_8c0;
}
else {
EVar14 = local_8cc;
}
EVar28 = (EntityPtr)this->_fallingSpeed;
if (((float)EVar14 < (float)EVar28) && (*GHIDRA_CAST<short *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x46e)))) == 0)) {
this->_fallingSpeed = (float)EVar14;
EVar28 = EVar14;
}
if ((float)EVar14 < (float)EVar28) goto LAB_0066863a;
}
*GHIDRA_CAST<short *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x46e)))) = *GHIDRA_CAST<short *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x46e)))) + 1;
this->_dead = 0;
in_stack_ffffd9fc = *GHIDRA_CAST<Vector **>(&(this->_tearFlags)._l);
qVar2 = (this->_tearFlags)._h;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_888)) + 0x0))) = 1;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(flags_00._h)) + 0x1))) = (char)(qVar2 >> 8);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(flags_00)) + 0x0))) = *GHIDRA_CAST<unkbyte9 *>(&this->_tearFlags);
(*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(&(flags_00._h)) + 0x2))) = (short)(qVar2 >> 0x10);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags_00._h)) + 0x4))) = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4));
tear_flags_area_apply
(pVVar9,GHIDRA_CAST<Entity *>(this),this->_size + 20.0,this->_collisionDamage * (float)local_904,
flags_00);
}
LAB_0066863a:
local_910 = 1.0;
auVar31 = ZEXT416(GHIDRA_UINT(oneConst));
iVar7 = this->_variant;
local_8c8 = GHIDRA_CAST<ANM2 *>(0x0);
local_898 = (EntityPtr)0x0;
local_88c = (EntityPtr)0x0;
local_8c4 = GHIDRA_CAST<BitSet128 *>(oneConst);
local_8a0 = (EntityPtr)oneConst;
switch(iVar7) {
case 0:
case 3:
case 5:
case 6:
case 7:
case 10:
case 0xb:
case 0xe:
case 0x10:
case 0x13:
case 0x15:
case 0x18:
case 0x1a:
case 0x1b:
case 0x1f:
case 0x24:
case 0x29:
case 0x2d:
case 0x30:
if (local_900 <= this->_fScale) {
if (0.8 <= this->_fScale) {
auVar31 = ZEXT416(GHIDRA_UINT(oneConst));
if (this->_height <= -5.0) {
local_88c = (EntityPtr)0x96;
local_8c8 = GHIDRA_CAST<ANM2 *>(0xc);
}
else {
local_88c = (EntityPtr)0x102;
local_8c8 = GHIDRA_CAST<ANM2 *>(&DAT_0000000d);
}
break;
}
auVar31 = ZEXT816(0x3f59999a);
local_88c = (EntityPtr)0x102;
local_8c8 = GHIDRA_CAST<ANM2 *>(&DAT_0000004f);
}
else {
auVar31 = ZEXT816(0x3f333333);
local_88c = (EntityPtr)0x102;
local_8c8 = GHIDRA_CAST<ANM2 *>(&DAT_00000050);
}
goto LAB_00668f76;
case 1:
case 0xc:
case 0xf:
case 0x11:
case 0x19:
case 0x20:
case 0x21:
case 0x22:
case 0x23:
case 0x25:
case 0x26:
case 0x27:
local_8c8 = GHIDRA_CAST<ANM2 *>(&DAT_0000000b);
local_88c = (EntityPtr)0x96;
goto LAB_00668f76;
case 2:
case 0x1e:
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite)::Color();
(GHIDRA_CAST<Color *>((&splashColor)))->Color::operator_assign(color);
if (this->_variant == 0x1e) {
(GHIDRA_CAST<Color *>((aCStack_388)))->Color::Color();
(GHIDRA_CAST<Color *>((aCStackY_3c4c + 0x81)))->Color::operator_assign(GHIDRA_CAST<ColorMod *>(&splashColor));
color = GHIDRA_CAST<ColorMod *>(FUN_004072e0());
(GHIDRA_CAST<Color *>((&splashColor)))->Color::operator_assign(color);
}
local_8c0 = (EntityPtr)this->_height;
fVar27 = random_float();
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>((fVar27 * (float)local_890 + 2.0));
Game::SpawnParticles
(g_game,&this->_pos,0x23,8,(float)in_stack_ffffd9fc,GHIDRA_CAST<ColorMod *>(&splashColor),
(float)local_8c0,1);
local_8c8 = GHIDRA_CAST<ANM2 *>(0x61);
local_88c = (EntityPtr)0xb5;
local_8c4 = GHIDRA_CAST<BitSet128 *>(halfConst);
fVar27 = random_float();
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) = (EntityPtr)(fVar27 * 0.2 + oneConst);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x4))) = extraout_var;
local_8a0 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0)));
break;
case 8:
local_8c8 = GHIDRA_CAST<ANM2 *>(&DAT_00000014);
local_88c = (EntityPtr)0x31;
local_8c4 = GHIDRA_CAST<BitSet128 *>(pointThreeConst);
fVar27 = random_float();
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) = (EntityPtr)(fVar27 * 0.1 + 0.95);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x4))) = extraout_var_01;
local_8a0 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0)));
break;
case 0xd:
case 0x17:
case 0x1c:
if ((iVar7 == 0xd) || (iVar7 == 0x17)) {
seeds = GHIDRA_CAST<Seeds *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetSeeds();
bVar4 = (GHIDRA_CAST<Seeds *>((seeds)))->Seeds::HasSeedEffect(0x4f);
if (bVar4 == 0) goto LAB_00668a9b;
iVar7 = Isaac::Random(5);
if ((iVar7 == 0) && ((this->_deathFlags & 1) != 0)) {
local_88c = (EntityPtr)0x33f;
local_8c4 = GHIDRA_CAST<BitSet128 *>(oneConst);
fVar27 = random_float();
local_8c8 = GHIDRA_CAST<ANM2 *>(0x61);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) = (EntityPtr)(fVar27 * pointSixConst + 0.8);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x4))) = extraout_var_03;
local_8a0 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0)));
break;
}
local_8c4 = GHIDRA_CAST<BitSet128 *>(zeroConst);
}
else {
LAB_00668a9b:
local_8c0 = (EntityPtr)this->_height;
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite)::Color();
fVar27 = random_float();
local_8b4 = (EntityPtr)(fVar27 * (float)local_890 + 2.0);
iVar7 = Isaac::Random(2);
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(local_8b4);
Game::SpawnParticles
(g_game,&this->_pos,0x56,iVar7 + 2,(float)local_8b4,color,(float)local_8c0,1);
local_8c4 = GHIDRA_CAST<BitSet128 *>(pointThreeConst);
}
local_88c = (EntityPtr)0x8a;
fVar27 = random_float();
local_8c8 = GHIDRA_CAST<ANM2 *>(0x61);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) = (EntityPtr)(fVar27 * halfConst + 2.0);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x4))) = extraout_var_04;
local_8a0 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0)));
break;
case 0x12:
local_8c0 = (EntityPtr)this->_height;
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite)::Color();
fVar27 = random_float();
local_8b4 = (EntityPtr)(fVar27 * (float)local_890 + 2.0);
iVar7 = Isaac::Random(2);
iVar7 = iVar7 + 2;
uVar37 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8c0)) + 0x0)));
uVar38 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8c0)) + 0x1)));
uVar39 = (*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(&(local_8c0)) + 0x2)));
variant = 0x55;
goto LAB_006689b3;
case 0x14:
local_8c0 = (EntityPtr)this->_height;
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite)::Color();
fVar27 = random_float();
local_8b4 = (EntityPtr)(fVar27 * (float)local_890 + 2.0);
iVar7 = Isaac::Random(2);
iVar7 = iVar7 + 4;
uVar37 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8c0)) + 0x0)));
uVar38 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8c0)) + 0x1)));
uVar39 = (*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(&(local_8c0)) + 0x2)));
variant = 0x62;
LAB_006689b3:
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(local_8b4);
Game::SpawnParticles
(g_game,&this->_pos,variant,iVar7,(float)local_8b4,color,
(float)CONCAT22(uVar39,CONCAT11(uVar38,uVar37)),1);
local_8c8 = GHIDRA_CAST<ANM2 *>(0x61);
local_88c = (EntityPtr)0x8a;
local_8c4 = GHIDRA_CAST<BitSet128 *>(pointThreeConst);
fVar27 = random_float();
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) = (EntityPtr)(fVar27 * halfConst + 2.0);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x4))) = extraout_var_02;
local_8a0 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0)));
break;
case 0x1d:
local_8c0 = (EntityPtr)this->_height;
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite)::Color();
fVar27 = random_float();
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>((fVar27 * (float)local_890 + 2.0));
Game::SpawnParticles
(g_game,&this->_pos,0x23,4,(float)in_stack_ffffd9fc,color,(float)local_8c0,1);
local_8c8 = GHIDRA_CAST<ANM2 *>(0x61);
local_88c = (EntityPtr)0x8a;
local_8c4 = GHIDRA_CAST<BitSet128 *>(pointThreeConst);
fVar27 = random_float();
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) = (EntityPtr)(fVar27 * halfConst + (float)local_890);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x4))) = extraout_var_00;
local_8a0 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0)));
break;
case 0x2a:
local_88c = (EntityPtr)0x1e7;
local_8c4 = GHIDRA_CAST<BitSet128 *>(Math)::clamp(halfConst,oneConst,this->_fScale * 1.4);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) = (EntityPtr)Math::clamp(0.95,1.8,oneConst / this->_fScale);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x4))) = extraout_var_05;
local_8c8 = GHIDRA_CAST<ANM2 *>(0x91);
local_8a0 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0)));
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
bVar4 = (GHIDRA_CAST<Room *>((room)))->Room::IsPositionInRoom(pVVar9,-20.0);
if (bVar4 != 0) {
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>((local_150 + 0x2c)))))->Color::Color();
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0x8c);
(GHIDRA_CAST<KColor *>((GHIDRA_CAST<KColor *>((local_150 + 0x2c)))))->KColor::FromRGBA255(0x8c,0x7b,0x7b,0xff);
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite)::Color();
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>((local_150 + 0x2c)))))->Color::__mul(color);
uStack_9e8 = 0x10;
uStack_b9c = 1;
fVar27 = random_float();
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) = (EntityPtr)(fVar27 * halfConst + oneConst);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x4))) = extraout_var_06;
particleCount = GHIDRA_INT((this->_fScale * 4.0 * (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)auVar31)) + 0x0)))));
std::max<int>();
pEVar19 = GHIDRA_CAST<EntityPtr *>(std)::min<int>();
local_89c = *pEVar19;
if (0 < GHIDRA_INT(local_89c)) {
do {
fVar27 = random_float();
Vector::FromAngle(&particleDir,fVar27 * 360.0);
fVar27 = random_float();
particleSpeed = fVar27 * 2.0 + oneConst;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) = (EntityPtr)random_float();
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x4))) = extraout_var_07;
particleDist = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)auVar31)) + 0x0)));
pVVar9 = (GHIDRA_CAST<Vector *>((&particleDir)))->Vector::__mul(&VStack_15a0,&particleDist);
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__mul(&VStack_15a8,&this->_size);
(GHIDRA_CAST<Vector *>((&this->_pos)))->Vector::__add(&particlePos,pVVar9);
uVar10 = Random();
pVVar9 = (GHIDRA_CAST<Vector *>((&particleDir)))->Vector::__mul(&VStack_15b0,&particleSpeed);
pEVar11 = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x23,&particlePos,pVVar9,GHIDRA_CAST<Entity *>(0x0),1,uVar10);
(GHIDRA_CAST<Entity *>((pEVar11)))->Entity::SetPositionOffset(&this->_posOffset);
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0xffffffff);
pEVar11->SetColor();
pEVar11->Update();
local_89c = (EntityPtr)(GHIDRA_INT(local_89c) + -1);
} while (local_89c != (EntityPtr)0x0);
local_89c = (EntityPtr)0x0;
}
}
break;
case 0x2b:
case 0x2c:
local_8c0 = (EntityPtr)this->_height;
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite)::Color();
fVar27 = random_float();
local_8b4 = (EntityPtr)(fVar27 * (float)local_890 + 2.0);
iVar7 = Isaac::Random(2);
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(local_8b4);
Game::SpawnParticles
(g_game,&this->_pos,0x56,iVar7 + 2,(float)local_8b4,color,(float)local_8c0,1);
local_88c = (EntityPtr)0x8a;
fVar27 = random_float();
local_8c8 = GHIDRA_CAST<ANM2 *>(0xc);
local_8a0 = (EntityPtr)(fVar27 * halfConst + 2.0);
local_898 = (EntityPtr)((this->_variant == 0x2c) + 0x14);
auVar31 = ZEXT416(GHIDRA_UINT(pointThreeConst));
goto LAB_00668f76;
case 0x2f:
local_88c = (EntityPtr)0x31;
goto LAB_00668eec;
case 0x31:
local_88c = (EntityPtr)0x86;
LAB_00668eec:
fVar27 = random_float();
local_8c8 = GHIDRA_CAST<ANM2 *>(0xc);
local_898 = (EntityPtr)0x16;
local_8a0 = (EntityPtr)(fVar27 * halfConst + 2.0);
auVar31 = ZEXT416(GHIDRA_UINT(pointThreeConst));
goto LAB_00668f76;
case 0x32:
local_88c = (EntityPtr)0x1e;
fVar27 = random_float();
local_8c8 = GHIDRA_CAST<ANM2 *>(0x2);
local_898 = (EntityPtr)0x2;
local_8a0 = (EntityPtr)(fVar27 * halfConst + 1.5);
auVar31 = ZEXT416(GHIDRA_UINT(pointSixConst));
LAB_00668f76:
local_8c4 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0)));
}
pVVar9 = &this->_pos;
pBVar6 = BitSet128::operator_and(&explosiveMask4,&this->_tearFlags,&g_tearFlagExplosive);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if ((bVar4 == 0) || ((this->_subtype & 2) != 0)) {
LAB_00668fdf:
if (this->_variant == 4) goto LAB_00668fe9;
}
else {
pBVar6 = BitSet128::operator_and(&ludovicoMask6,&this->_tearFlags,&g_tearFlagLudovico);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsZero();
if ((bVar4 == 0) && ((*GHIDRA_CAST<short *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x46e)))) < 2 && ((this->_deathFlags & 0x20) == 0))))
goto LAB_00668fdf;
LAB_00668fe9:
local_8c8 = GHIDRA_CAST<ANM2 *>(0x1);
Game::BombTearflagEffects(g_game,pVVar9,60.0,this->_tearFlags,GHIDRA_CAST<Entity *>(this),1.0);
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
cVar5 = DeathmatchManager::is_active();
if (cVar5 == '\0') {
local_89c = (EntityPtr)this->_collisionDamage;
}
else {
local_89c = (EntityPtr)0x420c0000;
}
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_888)) + 0x0))) != '\0') {
local_89c = (EntityPtr)((float)local_89c * halfConst);
}
local_8b4 = (EntityPtr)0x4;
if (this->_variant == 4) {
local_8b4 = (EntityPtr)0x40000004;
}
fVar27 = this->_size;
if (8.75 <= fVar27) {
local_9fc = fVar27 + (float)local_8f4;
local_a00 = 0x42700000;
}
else {
local_9f4 = 0x41f00000;
local_9f8 = (fVar27 * 60.0) / 8.75;
}
pfVar16 = GHIDRA_CAST<float *>(std)::max<float>();
local_910 = *pfVar16 / 60.0;
in_stack_ffffd9fc = *GHIDRA_CAST<Vector **>((GHIDRA_INT(&(this->_tearFlags)._h) + 4));
auVar31 = ZEXT416(GHIDRA_UINT(local_89c));
(GHIDRA_CAST<Game *>((g_game)))->Game::BombDamage(pVVar9,(float)local_89c,*pfVar16,1,GHIDRA_CAST<Entity *>(this),this->_tearFlags,
(ulonglong)GHIDRA_UINT(local_8b4),0);
pBVar6 = BitSet128::operator_and(&poisonMask,&this->_tearFlags,&g_tearFlagPoison);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
uVar10 = Random();
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,7,pVVar9,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar10);
pEVar11 = GHIDRA_CAST<Entity *>(__RTDynamicCast());
fVar27 = random_float();
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) = (EntityPtr)((fVar27 + oneConst) * local_910);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x4))) = extraout_var_08;
pVVar9 = (GHIDRA_CAST<Vector *>((&local_15b8)))->Vector::Vector((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)auVar31)) + 0x0))),(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)auVar31)) + 0x0))));
(GHIDRA_CAST<Entity *>((pEVar11)))->Entity::SetSpriteScale(pVVar9);
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(pEVar11) + 0x3c);
(GHIDRA_CAST<Color *>(()))->Color::Color();
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0xffffffff);
(*pcVar1)();
pEVar11->Update();
uVar10 = Random();
pEVar11 = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,2,tearPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),4,uVar10);
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(pEVar11) + 0x3c);
(GHIDRA_CAST<Color *>(()))->Color::Color();
(*pcVar1)();
pVVar9 = (GHIDRA_CAST<Vector *>((&local_15c0)))->Vector::Vector(local_910,local_910 * local_900);
(GHIDRA_CAST<Entity *>((pEVar11)))->Entity::SetSpriteScale(pVVar9);
set_field_358(pEVar11,-5.0);
pEVar11->Update();
this = tear;
}
}
pBVar6 = &this->_tearFlags;
pBVar8 = BitSet128::operator_and(&lasershotMask2,pBVar6,&g_tearFlagLasershot);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar8)))->BitSet128::IsNonZero();
if ((bVar4 != 0) && (local_8c8 != GHIDRA_CAST<ANM2 *>(0x1))) {
local_8c8 = GHIDRA_CAST<ANM2 *>(0x0);
}
pBVar8 = local_8c4;
if (((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_888)) + 0x0))) != '\0') && (local_8c8 != GHIDRA_CAST<ANM2 *>(0x1))) {
pBVar8 = GHIDRA_CAST<BitSet128 *>(((float)local_8c4 * halfConst));
bVar25 = local_8c8 == GHIDRA_CAST<ANM2 *>(&DAT_0000000b);
local_8c8 = GHIDRA_CAST<ANM2 *>(&DAT_0000000e);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_898)) + 0x1))) = 0;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_898)) + 0x0))) = bVar25;
}
if (local_88c != (EntityPtr)0x0) {
auVar31 = ZEXT416(GHIDRA_UINT(local_8a0));
in_stack_ffffd9fc = &this->_pos;
SoundEffects::PlayWithFartOverride2
(GHIDRA_INT(local_88c),GHIDRA_INT(in_stack_ffffd9fc),2,0,(float)local_8a0,(float)pBVar8);
}
pBVar8 = BitSet128::operator_and(&quadsplitMask,pBVar6,&g_tearFlagQuadsplit);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar8)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
MusicManager::RandomVector(&quadsplitVel);
pVVar9 = &this->_velocity;
local_88c = (EntityPtr)pVVar9;
local_8c0 = (EntityPtr)(GHIDRA_CAST<Vector *>((pVVar9)))->Vector::LengthSquared();
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) = ZEXT812(0x3dcccccd);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0xc))) = 0;
if ((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) <= (float)local_8c0) {
tearSpeed = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::Length();
pfVar16 = &tearSpeed;
}
else {
defaultSplitSpeed = 10.0;
pfVar16 = &defaultSplitSpeed;
}
(GHIDRA_CAST<Vector *>((&quadsplitVel)))->Vector::operator_mul_assign(pfVar16);
local_8a0 = (EntityPtr)0x0;
do {
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(&splitVel))))->EntityPtr::clear();
if (GHIDRA_UINT(local_8a0) < 2) {
pVVar9 = &quadsplitVel;
}
else {
pVVar9 = (GHIDRA_CAST<Vector *>((&local_15c8)))->Vector::Vector(quadsplitVel.y,-quadsplitVel.x);
}
(GHIDRA_CAST<Vector *>((&splitVel)))->Vector::operator_assign(pVVar9);
if ((GHIDRA_UINT(local_8a0) & 1) != 0) {
pVVar9 = (GHIDRA_CAST<Vector *>((&splitVel)))->Vector::__unm(&negated);
(GHIDRA_CAST<Vector *>((&splitVel)))->Vector::operator_assign(pVVar9);
}
local_8b4 = (EntityPtr)GetRootPlayer(this);
local_8c0 = (EntityPtr)this->_variant;
if (local_8c0 == (EntityPtr)0x32) {
local_8c0 = (EntityPtr)0x1;
}
uVar10 = Random();
EVar14 = this->_spawnerEntity;
pVVar9 = (GHIDRA_CAST<Vector *>((tearPos)))->Vector::__sub(&local_15d8,GHIDRA_CAST<Vector *>(local_88c));
spawnedTear = tear;
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(tear->_type,GHIDRA_UINT(local_8c0),pVVar9,&splitVel,GHIDRA_CAST<Entity *>(EVar14),0,uVar10);
EVar14 = (EntityPtr)__RTDynamicCast();
local_89c = EVar14;
if (local_8b4 == (EntityPtr)0x0) {
EVar28 = local_8b0;
}
else {
FUN_005cd770();
EVar28 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0)));
}
EVar28 = (EntityPtr)((float)EVar28 * halfConst);
(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(EVar14))))->Entity_Projectile::SetHeight((float)EVar28);
pBVar6 = BitSet128::operator_and
(&hydrobounceMask3,&spawnedTear->_tearFlags,&g_tearFlagHydrobounce);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 == 0) {
EVar28 = (EntityPtr)spawnedTear->_fallingAccel;
}
else if (local_8b4 == (EntityPtr)0x0) {
EVar28 = (EntityPtr)zeroConst;
}
else {
FUN_0060d070();
}
(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(EVar14))))->Entity_Projectile::set_falling_accel((float)EVar28);
(GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(0);
FUN_0060d060();
local_8b4 = EVar28;
if (zeroConst < (float)EVar28) {
local_8b4 = (EntityPtr)((float)EVar28 * pointThreeConst);
}
local_87c = (EntityPtr)(GHIDRA_CAST<BitSet128 *>((&g_tearFlagFetus)))->BitSet128::__bnot(&notFetus);
local_8ac = (EntityPtr)(GHIDRA_CAST<BitSet128 *>((&g_tearFlagHydrobounce)))->BitSet128::__bnot(&notHydrobounce);
local_8c4 = (GHIDRA_CAST<BitSet128 *>((&g_tearFlagAbsorb)))->BitSet128::__bnot(&notAbsorb);
local_8c0 = (EntityPtr)(GHIDRA_CAST<BitSet128 *>((&g_tearFlagBone)))->BitSet128::__bnot(&notBone);
pBVar6 = (GHIDRA_CAST<BitSet128 *>((&g_tearFlagLudovico)))->BitSet128::__bnot(&notLudovico);
pBVar8 = (GHIDRA_CAST<BitSet128 *>((&g_tearFlagSplit)))->BitSet128::__bnot(&notSplit);
pBVar35 = (GHIDRA_CAST<BitSet128 *>((&g_tearFlagQuadsplit)))->BitSet128::__bnot(&notQuadsplit);
pBVar35 = BitSet128::operator_and(&andResult3,tearFlagsPtr,pBVar35);
pBVar8 = BitSet128::operator_and(&andResult4,pBVar35,pBVar8);
pBVar6 = BitSet128::operator_and(&andResult5,pBVar8,pBVar6);
pBVar6 = BitSet128::operator_and(&andResult6,pBVar6,GHIDRA_CAST<BitSet128 *>(local_8c0));
pBVar6 = BitSet128::operator_and(&andResult7,pBVar6,local_8c4);
pBVar6 = BitSet128::operator_and(&andResult8,pBVar6,GHIDRA_CAST<BitSet128 *>(local_8ac));
BitSet128::operator_and(&inheritedFlags3,pBVar6,GHIDRA_CAST<BitSet128 *>(local_87c));
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_888)) + 0x0))) != '\0') {
(GHIDRA_CAST<BitSet128 *>((&g_tearFlagExplosive)))->BitSet128::__bnot(&notExplosive);
FUN_005cd430();
}
random_float();
EVar14 = local_89c;
FUN_00444c70();
this = tear;
(**(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x40))();
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags._l)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(inheritedFlags3._l)) + 0x4)));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags._l)) + 0x0))) = (undefined4)inheritedFlags3._l;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags._h)) + 0x0))) = (undefined4)inheritedFlags3._h;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(flags._h)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((char)inheritedFlags3._h)) + 0x4)));
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(flags._h)) + 0x5))) = (char)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(inheritedFlags3._h))) + 0x4))) >> 8);
(*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(&(flags._h)) + 0x6))) = (short)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(inheritedFlags3._h))) + 0x4))) >> 0x10);
SetTearFlags(GHIDRA_CAST<Entity_Tear *>(EVar14),flags);
fVar27 = this->_fScale * pointSixConst;
auVar31 = ZEXT416(GHIDRA_UINT(fVar27));
SetScale(GHIDRA_CAST<Entity_Tear *>(EVar14),fVar27);
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x3c);
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::Color();
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0xff);
(*pcVar1)();
EVar14 = local_89c;
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_89c))))->Entity::SetParent(GHIDRA_CAST<Entity *>(this->_parent));
(**(code **)(*GHIDRA_CAST<int *>(EVar14) + 0xc))();
local_8a0 = (EntityPtr)(GHIDRA_INT(local_8a0) + 1);
} while (GHIDRA_INT(local_8a0) < 4);
pBVar6 = &this->_tearFlags;
}
pBVar8 = BitSet128::operator_and(&burstsplitMask,pBVar6,&g_tearFlagBurstsplit);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar8)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
fire_split_projectiles(this,(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_888)) + 0x0))));
}
pBVar6 = BitSet128::operator_and(&laserMask2,pBVar6,&g_tearFlagLaser);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if ((bVar4 != 0) &&
(((this->_dead != 0 || (this->_techZeroTarget == (EntityPtr)0x0)) &&
(this->_techZeroLaser != (EntityPtr)0x0)))) {
(**(code **)(*GHIDRA_CAST<int *>(this->_techZeroLaser) + 0x28))();
}
pAVar22 = local_8c8;
if (local_8c8 != GHIDRA_CAST<ANM2 *>(0x0)) {
uVar10 = Random();
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,GHIDRA_UINT(pAVar22),&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(this),GHIDRA_UINT(local_898),
uVar10);
EVar14 = (EntityPtr)__RTDynamicCast();
local_88c = EVar14;
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::SetPositionOffset(&this->_posOffset);
if (((local_8c8 != GHIDRA_CAST<ANM2 *>(0x1)) && (local_8c8 != GHIDRA_CAST<ANM2 *>(&DAT_0000004f))) &&
(local_8c8 != GHIDRA_CAST<ANM2 *>(&DAT_00000050))) {
if (local_8c8 == GHIDRA_CAST<ANM2 *>(&DAT_0000000e)) {
poofSizeScale = (this->_size + 8.0) / 28.0;
pVVar9 = (GHIDRA_CAST<Vector *>((&g_vectorOne)))->Vector::__mul(&uniformScale3,&poofSizeScale);
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::SetSpriteScale(pVVar9);
pVVar9 = (GHIDRA_CAST<Vector *>((&local_15e8)))->Vector::Vector((this->_posOffset).x,zeroConst);
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::SetPositionOffset(pVVar9);
}
else {
if (((local_8c8 == GHIDRA_CAST<ANM2 *>(&DAT_00000014)) || (this->_variant == 0xf)) ||
(this->_variant == 0xe)) {
pfVar16 = &poofScaleSmall;
poofScaleSmall = this->_fScale * local_900;
pVVar9 = &local_15f8;
}
else {
pfVar16 = &poofScaleLarge;
poofScaleLarge = this->_fScale * 0.8;
pVVar9 = &local_15f0;
}
pVVar9 = (GHIDRA_CAST<Vector *>((&g_vectorOne)))->Vector::__mul(pVVar9,pfVar16);
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::SetSpriteScale(pVVar9);
}
Isaac::Random(4);
FUN_0043eea0();
}
auVar31 = ZEXT416(GHIDRA_UINT(local_910));
if (local_910 != oneConst) {
pVVar9 = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity)::SpriteScale();
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__mul(&local_1600,&local_910);
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::SetSpriteScale(pVVar9);
}
switch(this->_variant) {
case 3:
case 0x13:
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x3c);
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&tear->_sprite))))->Sprite::Color();
auVar31 = ZEXT416(GHIDRA_UINT(pointThreeConst));
(GHIDRA_CAST<Color *>((aCStackY_3c4c + 0x81)))->Color::Color();
FUN_004072e0();
EVar14 = local_88c;
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0xffffffff);
(*pcVar1)();
this = tear;
break;
case 4:
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x3c);
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&tear->_sprite))))->Sprite::Color();
(GHIDRA_CAST<Color *>((0x3f800000)))->Color::Color(0,0x55,0);
FUN_004072e0();
EVar14 = local_88c;
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0xffffffff);
(*pcVar1)();
this = tear;
break;
case 5:
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x3c);
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&tear->_sprite))))->Sprite::Color();
(GHIDRA_CAST<Color *>((aCStackY_3c4c + 0x81)))->Color::Color();
FUN_004072e0();
EVar14 = local_88c;
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0xffffffff);
(*pcVar1)();
this = tear;
break;
case 6:
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x3c);
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&tear->_sprite))))->Sprite::Color();
auVar31 = ZEXT816(0x3dcccccd);
(GHIDRA_CAST<Color *>((aCStackY_3c4c + 0x81)))->Color::Color();
FUN_004072e0();
EVar14 = local_88c;
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0xffffffff);
(*pcVar1)();
this = tear;
break;
case 7:
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x3c);
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&tear->_sprite))))->Sprite::Color();
(GHIDRA_CAST<Color *>((aCStackY_3c4c + 0x81)))->Color::Color();
FUN_004072e0();
EVar14 = local_88c;
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0xffffffff);
(*pcVar1)();
this = tear;
break;
default:
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x3c);
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::Color();
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0xffffffff);
(*pcVar1)();
EVar14 = local_88c;
break;
case 0x12:
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x3c);
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&tear->_sprite))))->Sprite::Color();
auVar31 = ZEXT416(GHIDRA_UINT(oneConst));
(GHIDRA_CAST<Color *>((0x3f800000)))->Color::Color(0,0x46,0xff);
FUN_004072e0();
EVar14 = local_88c;
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0xffffffff);
(*pcVar1)();
this = tear;
break;
case 0x14:
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x3c);
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&tear->_sprite))))->Sprite::Color();
auVar31 = ZEXT416(GHIDRA_UINT(oneConst));
(GHIDRA_CAST<Color *>((0x3f800000)))->Color::Color(0xe6,0xe6,0);
FUN_004072e0();
EVar14 = local_88c;
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0xffffffff);
(*pcVar1)();
this = tear;
break;
case 0x1a:
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x3c);
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&tear->_sprite))))->Sprite::Color();
(GHIDRA_CAST<Color *>((0x3f800000)))->Color::Color(0,0,0);
FUN_004072e0();
EVar14 = local_88c;
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0xffffffff);
(*pcVar1)();
this = tear;
break;
case 0x1b:
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x3c);
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&tear->_sprite))))->Sprite::Color();
auVar31 = ZEXT416(GHIDRA_UINT(halfConst));
(GHIDRA_CAST<Color *>((0x3f800000)))->Color::Color(0x3f000000,0x3f000000,0x3f000000);
FUN_004072e0();
EVar14 = local_88c;
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0xffffffff);
(*pcVar1)();
this = tear;
break;
case 0x1f:
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x3c);
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&tear->_sprite))))->Sprite::Color();
auVar31 = ZEXT816(0x3dcccccd);
(GHIDRA_CAST<Color *>((aCStackY_3c4c + 0x81)))->Color::Color();
FUN_004072e0();
EVar14 = local_88c;
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0xffffffff);
(*pcVar1)();
this = tear;
break;
case 0x26:
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x3c);
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&tear->_sprite))))->Sprite::Color();
auVar31 = ZEXT416(GHIDRA_UINT(pointThreeConst));
(GHIDRA_CAST<Color *>((aCStackY_3c4c + 0x81)))->Color::Color();
FUN_004072e0();
EVar14 = local_88c;
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0xffffffff);
(*pcVar1)();
this = tear;
break;
case 0x2d:
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x3c);
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&tear->_sprite))))->Sprite::Color();
auVar31 = ZEXT416(GHIDRA_UINT(oneConst));
(GHIDRA_CAST<Color *>((0x3f800000)))->Color::Color(0x3f800000,0x3f19999a,0x3f47ae14,0x3f800000,0,0,0);
FUN_004072e0();
EVar14 = local_88c;
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0xffffffff);
(*pcVar1)();
this = tear;
break;
case 0x30:
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x3c);
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&tear->_sprite))))->Sprite::Color();
(GHIDRA_CAST<Color *>((aCStackY_3c4c + 0x81)))->Color::Color();
FUN_004072e0();
EVar14 = local_88c;
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0xffffffff);
(*pcVar1)();
this = tear;
}
pEVar17 = GHIDRA_CAST<Entity_Player *>(__RTDynamicCast());
if ((pEVar17 != GHIDRA_CAST<Entity_Player *>(0x0)) &&
(bVar4 = (GHIDRA_CAST<Entity_Player *>((pEVar17)))->Entity_Player::IsLocalPlayer(), bVar4 == 0)) {
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity)::GetColor();
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_150))))->Color::operator_assign(color);
FUN_00417900();
FUN_00925df0();
local_87c = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0)));
fVar27 = (GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_150))))->Color::A();
auVar31 = ZEXT416(GHIDRA_UINT(local_87c));
(GHIDRA_CAST<Font *>((GHIDRA_CAST<Font *>(local_150))))->Font::SetLineHeightModifier(fVar27 * (float)local_87c);
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0xffffffff);
(**(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x3c))();
}
}
iVar7 = this->_variant;
if (((((((iVar7 == 0) || (iVar7 == 0x18)) || (iVar7 == 0x10)) ||
((iVar7 == 0x1b || (iVar7 == 0x21)))) || (iVar7 == 0x22)) ||
((iVar7 == 0x23 || (iVar7 == 0x24)))) || ((iVar7 == 0x25 || (iVar7 == 0x26)))) {
bloodParticleCount = Isaac::Random(5);
if (this->_variant == 0x1b) {
minBloodParticles = 3;
piVar12 = GHIDRA_CAST<int *>(std)::max<int>();
bloodParticleCount = *piVar12;
}
local_8b4 = (EntityPtr)GetRootPlayer(this);
local_89c = (EntityPtr)0x0;
if (0 < bloodParticleCount) {
do {
uVar10 = Random();
pVVar9 = MusicManager::RandomVector(&randomDir);
bloodParticleDist = random_float();
bloodParticleDist = bloodParticleDist * 24.0;
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__mul(&local_1610,&bloodParticleDist);
pVVar9 = (GHIDRA_CAST<Vector *>((tearPos)))->Vector::__add(&local_1618,pVVar9);
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,7,pVVar9,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar10);
pEVar11 = GHIDRA_CAST<Entity *>(__RTDynamicCast());
bloodParticleScale = 0.3;
pVVar9 = (GHIDRA_CAST<Vector *>((&g_vectorOne)))->Vector::__mul(&uniformScale4,&bloodParticleScale);
(GHIDRA_CAST<Entity *>((pEVar11)))->Entity::SetSpriteScale(pVVar9);
auVar31 = ZEXT416(GHIDRA_UINT(zeroConst));
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_7c))))->Color::Color();
(GHIDRA_CAST<Font *>((GHIDRA_CAST<Font *>(local_7c))))->Font::SetLineHeightModifier(0.08);
this = tear;
if (tear->_variant == 0x1b) {
LAB_0066a2e0:
auVar31 = ZEXT416(GHIDRA_UINT(zeroConst));
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Color *>(()))->Color)::Color();
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_7c))))->Color::operator_assign(color);
}
else if (local_8b4 == (EntityPtr)0x0) {
LAB_0066a2bc:
if ((this->_variant == 0x21) || (this->_variant == 0x22)) goto LAB_0066a2e0;
}
else {
bVar4 = (GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(local_8b4))))->Entity_Player::HasCollectible(0x136,0);
if (bVar4 == 0) {
bVar4 = (GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(local_8b4))))->Entity_Player::HasCollectible(6,0);
if (bVar4 != 0) goto LAB_0066a2e0;
goto LAB_0066a2bc;
}
fVar27 = random_float();
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) = (EntityPtr)(fVar27 * pointThreeConst + 0.2);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x4))) = extraout_var_09;
(GHIDRA_CAST<Font *>((GHIDRA_CAST<Font *>(local_7c))))->Font::SetLineHeightModifier((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)auVar31)) + 0x0))));
}
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0xffffffff);
pEVar11->SetColor();
pEVar11->Update();
local_89c = (EntityPtr)(GHIDRA_INT(local_89c) + 1);
} while (GHIDRA_INT(local_89c) < bloodParticleCount);
}
}
if (this->_dead != 0) {
pBVar6 = BitSet128::operator_and(&attractorMask,&this->_tearFlags,&g_tearFlagAttractor);
(GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
this->Remove();
ExceptionList = prevExceptionList;
return;
}
LAB_0066a370:
pBVar6 = BitSet128::operator_and(&squareMask,&this->_tearFlags,&g_tearFlagSquare);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if ((bVar4 == 0) || (iVar7 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::FrameCount(), iVar7 < 3)) goto LAB_0066a545;
if (local_8d8 == (EntityPtr)0x0) {
auVar33 = (undefined1 [12])0x0;
fVar27 = oneConst;
}
else {
fVar27 = get_tear_trinket_multiplier(GHIDRA_CAST<Entity_Player *>(local_8d8),0x1e);
auVar33 = extraout_var_10;
}
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) = (EntityPtr)(fVar27 * halfConst + halfConst);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x4))) = auVar33;
squareSpeedScale = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)auVar31)) + 0x0)));
iVar7 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::FrameCount();
if (iVar7 < 5) {
iVar7 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::FrameCount();
if (iVar7 == 3) {
pVVar15 = (GHIDRA_CAST<Vector *>((&velPerpRight)))->Vector::Vector((this->_velocity).y,-(this->_velocity).x);
pVVar9 = &local_1670;
goto LAB_0066a52b;
}
goto LAB_0066a545;
}
iVar7 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::FrameCount();
switch((iVar7 + -5) % 0x16) {
case 0:
pVVar9 = (GHIDRA_CAST<Vector *>((&velPerpLeft)))->Vector::Vector(-(this->_velocity).y,(this->_velocity).x);
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__div(&VStack_1630,&squareSpeedScale);
break;
default:
goto LAB_0066a545;
case 7:
pVVar15 = (GHIDRA_CAST<Vector *>((&velPerpLeft2)))->Vector::Vector(-(this->_velocity).y,(this->_velocity).x);
pVVar9 = &VStack_1640;
goto LAB_0066a52b;
case 10:
pVVar9 = (GHIDRA_CAST<Vector *>((&velPerpRight2)))->Vector::Vector((this->_velocity).y,-(this->_velocity).x);
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__div(&VStack_1650,&squareSpeedScale);
break;
case 0x13:
pVVar15 = (GHIDRA_CAST<Vector *>((&velPerpRight3)))->Vector::Vector((this->_velocity).y,-(this->_velocity).x);
pVVar9 = &VStack_1660;
LAB_0066a52b:
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar15)))->Vector::__mul(pVVar9,&squareSpeedScale);
}
(GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::operator_assign(pVVar9);
LAB_0066a545:
pBVar8 = &this->_tearFlags;
pBVar6 = BitSet128::operator_or(&withOrbitAdvanced,&g_tearFlagOrbit,&g_tearFlagOrbitAdvanced);
pBVar6 = BitSet128::operator_and(&andResult9,pBVar8,pBVar6);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if ((bVar4 != 0) && (this->_target == (EntityPtr)0x0)) {
local_8a0 = this->_spawnerEntity;
if (local_8a0 == (EntityPtr)0x0) {
local_8a0 = this->_parent;
}
pBVar6 = BitSet128::operator_and(&ludovicoMask7,pBVar8,&g_tearFlagLudovico);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 == 0) {
if ((local_8a0 != (EntityPtr)0x0) ||
(bVar4 = (GHIDRA_CAST<Vector *>((&this->_targetPosition)))->Vector::operator_ne(&g_vectorZero), bVar4 != 0)) {
pBVar6 = BitSet128::operator_and(&tractorBeamMask,pBVar8,&g_tearFlagTractorBeam);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsZero();
if (bVar4 != 0) {
pBVar6 = BitSet128::operator_and(&orbitAdvancedMask,pBVar8,&g_tearFlagOrbitAdvanced);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if ((bVar4 == 0) && (this->_waitFrames < 2)) {
if ((this->_tearIdx & 1) == 0) {
local_8b4 = (EntityPtr)oneConst;
}
else {
local_8b4 = (EntityPtr)&DAT_bf800000;
}
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(&local_98c))))->EntityPtr::clear();
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(&local_b6c))))->EntityPtr::clear();
bVar4 = (GHIDRA_CAST<Vector *>((&this->_targetPosition)))->Vector::operator_eq(&g_vectorZero);
if (bVar4 == 0) {
pVVar9 = (GHIDRA_CAST<Vector *>((&this->_pos)))->Vector::__add(&nextPos3,&this->_velocity);
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__sub(&local_16c0,&this->_targetPosition);
(GHIDRA_CAST<Vector *>((&local_98c)))->Vector::operator_assign(pVVar9);
pVVar9 = &this->_orbitVelocity;
pVVar15 = &g_vectorZero;
}
else {
pVVar9 = (GHIDRA_CAST<Vector *>((&this->_pos)))->Vector::__add(&nextPos4,&this->_velocity);
pVVar15 = GHIDRA_CAST<Vector *>(FUN_004172b0());
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__sub(local_16a8,pVVar15);
(GHIDRA_CAST<Vector *>((&local_98c)))->Vector::operator_assign(pVVar9);
pVVar15 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_8a0))))->Entity::Velocity(&entityVel);
pVVar9 = &local_b6c;
}
(GHIDRA_CAST<Vector *>((pVVar9)))->Vector::operator_assign(pVVar15);
bVar4 = (GHIDRA_CAST<Vector *>((&this->_targetPosition)))->Vector::operator_eq(&g_vectorZero);
if ((bVar4 != 0) && (bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_8a0))))->Entity::is_player(), bVar4 != 0)) {
pVVar9 = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(local_8a0))))->Entity_Player)::GetAimDirection();
local_a30 = 60.0;
pVVar9 = Vector::operator_mul(&local_16c8,&local_a30,pVVar9);
(GHIDRA_CAST<Vector *>((&local_98c)))->Vector::operator__(pVVar9);
}
local_928 = (GHIDRA_CAST<Vector *>((&local_98c)))->Vector::Length();
auVar31 = ZEXT416(GHIDRA_UINT(local_928));
if (local_928 != zeroConst) {
(GHIDRA_CAST<Vector *>((&local_98c)))->Vector::__div(&local_c90,&local_928);
(GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::operator__(&this->_orbitVelocity);
local_888 = (EntityPtr)0x42f00000;
local_924 = 0.1;
pBVar6 = BitSet128::operator_and
(&boomerangMask,&this->_tearFlags,&g_tearFlagBoomerang);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 == 0) {
EVar14 = (EntityPtr)0x42f00000;
}
else {
local_938 = assert_lerp_range(this->_height,-5.0,-24.0,0.05,1.5,1);
pBVar6 = BitSet128::operator_and
(&explosiveMask5,&this->_tearFlags,&g_tearFlagExplosive);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
local_a34 = 0x3ecccccd;
pfVar16 = GHIDRA_CAST<float *>(std)::max<float>();
local_938 = *pfVar16;
}
local_888 = (EntityPtr)(local_938 * 120.0);
local_924 = (2.5 - local_938) * local_924;
EVar14 = local_888;
}
local_924 = ((float)EVar14 - local_928) * local_924;
fVar27 = (GHIDRA_CAST<Vector *>((&local_c90)))->Vector::GetAngleDegrees();
local_87c = (EntityPtr)((float)local_8b4 * 90.0);
local_89c = (EntityPtr)(fVar27 + (float)local_87c);
fVar27 = zeroConst;
FUN_00a155f0();
fVar27 = Math::clamp(zeroConst,oneConst,fVar27);
local_8ac = (EntityPtr)pow(fVar27,2.0);
fVar27 = (GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::GetAngleDegrees();
local_87c = (EntityPtr)((float)local_89c - fVar27);
fVar27 = normalize_angle_degrees((float)local_87c);
local_87c = (EntityPtr)(fVar27 * (float)local_8ac);
fVar27 = (GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::GetAngleDegrees();
local_89c = (EntityPtr)(fVar27 + (float)local_87c);
auVar31 = ZEXT416(GHIDRA_UINT(local_89c));
Vector::FromAngle(&local_da0,(float)local_89c);
local_968 = (GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::Length();
pVVar9 = (GHIDRA_CAST<Vector *>((&local_da0)))->Vector::__mul(&local_16d0,&local_968);
pVVar15 = (GHIDRA_CAST<Vector *>((&local_c90)))->Vector::__mul(&local_16d8,&local_924);
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__add(&local_e40,pVVar15);
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::Normalized(&direction);
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__mul(&local_e50,&local_968);
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__add(&local_e58,&local_b6c);
(GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::operator_assign(pVVar9);
pVVar9 = &local_b6c;
pVVar15 = &this->_orbitVelocity;
goto LAB_0066aff6;
}
}
else {
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(&local_9bc))))->EntityPtr::clear();
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(&local_c98))))->EntityPtr::clear();
bVar4 = (GHIDRA_CAST<Vector *>((&this->_targetPosition)))->Vector::operator_eq(&g_vectorZero);
if (bVar4 == 0) {
(GHIDRA_CAST<Vector *>((&local_9bc)))->Vector::operator_assign(&this->_targetPosition);
pVVar9 = &g_vectorZero;
}
else {
pVVar9 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_8a0))))->Entity::Position(&entityPos4);
(GHIDRA_CAST<Vector *>((&local_9bc)))->Vector::operator_assign(pVVar9);
pVVar9 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_8a0))))->Entity::Velocity(&entityVel2);
Entity::get_friction();
local_a38 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0)));
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__div(&local_e70,&local_a38);
}
(GHIDRA_CAST<Vector *>((&local_c98)))->Vector::operator_assign(pVVar9);
if (this->_orbitRadius == zeroConst) {
(GHIDRA_CAST<Vector *>((&this->_pos)))->Vector::__sub(&local_b74,&local_9bc);
local_950.x = (this->_velocity).x;
local_950.y = (this->_velocity).y;
if (1 < this->_waitFrames) {
(GHIDRA_CAST<Vector *>((&local_950)))->Vector::operator_assign(&this->_continueVelocity);
}
pVVar9 = (GHIDRA_CAST<Vector *>((&local_b74)))->Vector::Normalized(&direction2);
pVVar15 = (GHIDRA_CAST<Vector *>((&local_950)))->Vector::Normalized(&direction3);
local_87c = (EntityPtr)(GHIDRA_CAST<Vector *>((pVVar9)))->Vector::Dot(pVVar15);
if ((float)local_87c < 0.8) {
pVVar9 = (GHIDRA_CAST<Vector *>((&local_b74)))->Vector::Rotated(&perpDir,90.0);
local_87c = (EntityPtr)(GHIDRA_CAST<Vector *>((pVVar9)))->Vector::Dot(&local_950);
local_8b4 = (EntityPtr)&DAT_bf800000;
if (zeroConst <= (float)local_87c) {
local_8b4 = (EntityPtr)0x3f800000;
}
fVar27 = (GHIDRA_CAST<Vector *>((&local_950)))->Vector::Length();
fVar27 = fVar27 * (float)local_8b4;
pVVar9 = &local_b74;
}
else {
local_8b4 = (EntityPtr)0x3f800000;
if ((this->_tearIdx & 1) == 0) {
local_8b4 = (EntityPtr)&DAT_bf800000;
}
fVar27 = (GHIDRA_CAST<Vector *>((&local_950)))->Vector::Length();
fVar27 = fVar27 * (float)local_8b4;
pVVar9 = &local_950;
}
this->_orbitRadius = fVar27;
fVar27 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::GetAngleDegrees();
this->_orbitAngle = fVar27;
}
local_93c = 90.0;
if (0 < this->_waitFrames) {
local_93c = 30.0;
}
pVVar9 = Vector::FromAngle(&orbitDir,this->_orbitAngle);
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__mul(&local_e98,&local_93c);
(GHIDRA_CAST<Vector *>((&local_9bc)))->Vector::__add(&local_da8,pVVar9);
local_a3c = 0x40a00000;
fVar27 = this->_orbitRadius;
Math::abs();
local_a40 = fVar27;
puVar13 = GHIDRA_CAST<undefined4 *>(std)::max<float>();
local_8ac = (EntityPtr)*puVar13;
local_a44 = 2.0;
Vector::operator_mul(&local_ca0,&local_a44,&local_c98);
pVVar9 = (GHIDRA_CAST<Vector *>((&this->_pos)))->Vector::__add(&local_ea0,&local_ca0);
pVVar9 = (GHIDRA_CAST<Vector *>((&local_da8)))->Vector::__sub(&local_ea8,pVVar9);
local_a48 = 0.5;
Vector::operator_mul(&local_b7c,&local_a48,pVVar9);
local_87c = (EntityPtr)(GHIDRA_CAST<Vector *>((&local_b7c)))->Vector::Length();
if ((float)local_8ac < (float)local_87c) {
(GHIDRA_CAST<Vector *>((&local_b7c)))->Vector::Resize((float)local_8ac);
}
pVVar9 = (GHIDRA_CAST<Vector *>((&local_ca0)))->Vector::__add(&local_eb0,&local_b7c);
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__div(&local_eb8,&this->_friction);
(GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::operator_assign(pVVar9);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) =
(EntityPtr)
normalize_angle_degrees
((((this->_orbitRadius / local_93c) * 180.0) / 3.1415927) *
this->_speedMultiplier + this->_orbitAngle);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x4))) = extraout_var_11;
this->_orbitAngle = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)auVar31)) + 0x0)));
if (1 < this->_waitFrames) {
pVVar9 = Vector::FromAngle(&angleDir,(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)auVar31)) + 0x0))));
auVar31 = ZEXT416(GHIDRA_UINT(this->_orbitRadius));
Math::abs();
local_a4c = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0)));
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0x66afed);
pVVar9 = Vector::operator_mul(&local_ec8,&local_a4c,pVVar9);
pVVar15 = &this->_continueVelocity;
LAB_0066aff6:
(GHIDRA_CAST<Vector *>((pVVar15)))->Vector::operator_assign(pVVar9);
}
}
}
}
}
else {
bVar4 = is_not_familiar_spawned(this);
if ((bVar4 != 0) && (local_8a0 != (EntityPtr)0x0)) {
pVVar9 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_8a0))))->Entity::Position(&entityPos5);
(GHIDRA_CAST<Vector *>((&this->_pos)))->Vector::__sub(&local_ce8,pVVar9);
local_92c = (GHIDRA_CAST<Vector *>((&local_ce8)))->Vector::Length();
if (local_92c == zeroConst) {
local_92c = 0.1;
}
(GHIDRA_CAST<Vector *>((&local_ce8)))->Vector::__div(&local_b64,&local_92c);
local_a2c = (100.0 - local_92c) * 0.01;
(GHIDRA_CAST<Vector *>((&local_b5c)))->Vector::Vector(local_b64.y,-local_b64.x);
local_87c = (EntityPtr)(GHIDRA_CAST<Vector *>((&local_b5c)))->Vector::Dot(&this->_velocity);
auVar31 = ZEXT416(GHIDRA_UINT(zeroConst));
if ((float)local_87c < zeroConst) {
local_a24 = &DAT_bf800000;
(GHIDRA_CAST<Vector *>((&local_b5c)))->Vector::operator_mul_assign(GHIDRA_CAST<float *>(&local_a24));
}
local_a28 = 1.0;
pVVar9 = (GHIDRA_CAST<Vector *>((&local_b5c)))->Vector::__mul(&local_1680,&local_a28);
pVVar15 = (GHIDRA_CAST<Vector *>((&local_b64)))->Vector::__mul(&local_1688,&local_a2c);
bVar4 = 0;
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0x66a724);
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__add(&local_1690,pVVar15);
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::AddVelocity_divided(pVVar9,bVar4);
}
}
}
pBVar6 = BitSet128::operator_and(&fetusMask,&this->_tearFlags,&g_tearFlagFetus);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 == 0) {
pBVar6 = BitSet128::operator_and(&homingMask,&this->_tearFlags,&g_tearFlagHoming);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 == 0) {
pBVar6 = BitSet128::operator_and
(&turnHorizontalMask,&this->_tearFlags,&g_tearFlagTurnHorizontal);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 == 0) goto LAB_0066d04f;
}
if ((this->_target != (EntityPtr)0x0) &&
(bVar4 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(&this->_hitList))))->EntityList::HitListContains(GHIDRA_CAST<Entity *>(this->_target)),
bVar4 != 0)) {
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::SetTarget(GHIDRA_CAST<Entity *>(0x0));
}
if (this->_target == (EntityPtr)0x0) {
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(4,this->_index);
if (bVar4 != 0) {
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) = ZEXT812(0x4e6e6b28);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0xc))) = 0;
local_8a0 = (EntityPtr)0x0;
local_898 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0)));
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
local_c30 = (void *)0x40a00000;
pVVar9 = Vector::operator_mul(&local_1030,GHIDRA_CAST<float *>(&local_c30),&this->_velocity);
pVVar9 = (GHIDRA_CAST<Vector *>((&this->_pos)))->Vector::__add(&local_1038,pVVar9);
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0x66cbd8);
EntityList::QueryRadius(entityList,GHIDRA_CAST<EntityList_EL *>(aheadQuery),pVVar9,128.0,8);
ehState = 3;
local_888 = (EntityPtr)0x0;
iVar7 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(aheadQuery))))->EntityList::Size();
if (iVar7 != 0) {
do {
pEVar19 = GHIDRA_CAST<EntityPtr *>(std)::vector<int>::operator_index();
EVar14 = *pEVar19;
local_89c = EVar14;
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
if (bVar4 != 0) {
if (this->_spawnerEntity != (EntityPtr)0x0) {
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this->_spawnerEntity))))->Entity::IsDescendantOf(GHIDRA_CAST<Entity *>(EVar14));
if (bVar4 != 0) goto LAB_0066cdbc;
}
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::HasEntityFlags(0x20000010);
if (bVar4 == 0) {
bVar4 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(&this->_hitList))))->EntityList::HitListContains(GHIDRA_CAST<Entity *>(EVar14));
if (bVar4 == 0) {
puVar13 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar13))))->Entity::is_player();
if (bVar4 != 0) {
puVar13 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
bVar4 = (GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(*puVar13))))->Entity_Player::IsInvisible();
if (bVar4 != 0) goto LAB_0066cdbc;
}
iVar7 = Isaac::Random(2);
if (iVar7 != 0) {
if (this->_entityGridCollisionClass == 4) {
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
pVVar9 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_89c))))->Entity::Position(&entityPos6);
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0x0);
bVar4 = (GHIDRA_CAST<Room *>((room)))->Room::CheckLine(&this->_pos,pVVar9,3,0,0,0,GHIDRA_CAST<Vector *>(0x0));
if (bVar4 == 0) goto LAB_0066cdbc;
}
local_c2c = (void *)0x40a00000;
pVVar9 = Vector::operator_mul(&local_1048,GHIDRA_CAST<float *>(&local_c2c),&this->_velocity);
pVVar9 = (GHIDRA_CAST<Vector *>((&this->_pos)))->Vector::__add(&local_1050,pVVar9);
pVVar15 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_89c))))->Entity::Position(&entityPos7);
local_8ac = (EntityPtr)(GHIDRA_CAST<Vector *>((pVVar9)))->Vector::Distance(pVVar15);
fVar27 = random_float();
EVar28 = local_89c;
local_87c = (EntityPtr)(fVar27 * 128.0);
local_8d0 = (EntityPtr)((float)local_87c + (float)local_8ac);
bVar4 = EntityList::HitListContains
(GHIDRA_CAST<EntityList *>(&this->_hitList),GHIDRA_CAST<Entity *>(local_89c));
EVar14 = local_8d0;
if (bVar4 != 0) {
EVar14 = (EntityPtr)((float)local_8d0 + 1000.0);
}
auVar31 = ZEXT416(GHIDRA_UINT(EVar14));
if ((float)EVar14 < (float)local_898) {
local_8a0 = EVar28;
local_898 = EVar14;
}
}
}
}
}
LAB_0066cdbc:
local_888 = (EntityPtr)(GHIDRA_INT(local_888) + 1);
EVar14 = (EntityPtr)(GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(aheadQuery))))->EntityList::Size();
} while (GHIDRA_UINT(local_888) < GHIDRA_UINT(EVar14));
}
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
cVar5 = DeathmatchManager::is_active();
if (cVar5 != '\0') {
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0x43);
EntityList::QuerySublist
(entityList,GHIDRA_CAST<EntityList_EL *>(deathmatchFamiliarQuery),3,0x43,-1,1,0);
EVar14 = (EntityPtr)0x0;
ehState = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(ehState)) + 0x1))),4);
local_888 = (EntityPtr)0x0;
iVar7 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(deathmatchFamiliarQuery))))->EntityList::Size();
if (iVar7 != 0) {
do {
puVar13 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar13))))->Entity::IsDescendantOf(GHIDRA_CAST<Entity *>(this->_spawnerEntity));
if (bVar4 == 0) {
local_c28 = 5.0;
pVVar9 = Vector::operator_mul(&local_1060,&local_c28,&this->_velocity);
pVVar9 = (GHIDRA_CAST<Vector *>((&this->_pos)))->Vector::__add(&local_1068,pVVar9);
puVar13 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
pVVar15 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar13))))->Entity::Position(&entityPos8);
local_8ac = (EntityPtr)(GHIDRA_CAST<Vector *>((pVVar9)))->Vector::Distance(pVVar15);
fVar27 = random_float();
EVar14 = local_888;
local_87c = (EntityPtr)(fVar27 * 128.0);
local_8d0 = (EntityPtr)((float)local_87c + (float)local_8ac);
auVar31 = ZEXT416(GHIDRA_UINT(local_898));
if ((float)local_8d0 < (float)local_898) {
pEVar19 = GHIDRA_CAST<EntityPtr *>(std)::vector<int>::operator_index();
auVar31 = ZEXT416(GHIDRA_UINT(local_8d0));
local_898 = local_8d0;
local_8a0 = *pEVar19;
}
}
EVar14 = (EntityPtr)(GHIDRA_INT(EVar14) + 1);
local_888 = EVar14;
EVar28 = (EntityPtr)(GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(deathmatchFamiliarQuery))))->EntityList::Size();
} while (GHIDRA_UINT(EVar14) < GHIDRA_UINT(EVar28));
}
ehState = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(ehState)) + 0x1))),3);
(GHIDRA_CAST<EntityList_Query *>((deathmatchFamiliarQuery)))->EntityList_Query::~EntityList_Query();
}
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::SetTarget(GHIDRA_CAST<Entity *>(local_8a0));
ehState = 0xffffffff;
(GHIDRA_CAST<EntityList_Query *>((aheadQuery)))->EntityList_Query::~EntityList_Query();
}
if (this->_target == (EntityPtr)0x0) goto LAB_0066d04f;
}
pBVar6 = BitSet128::operator_and(&homingMask2,&this->_tearFlags,&g_tearFlagHoming);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
pVVar9 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this->_target))))->Entity::Position(&targetPos);
(GHIDRA_CAST<Vector *>((&this->_pos)))->Vector::__sub(&fromTarget,pVVar9);
pVVar9 = (GHIDRA_CAST<Vector *>((&fromTarget)))->Vector::Normalized(&direction4);
pVVar9 = Vector::operator_mul(&local_1088,&this->_speedMultiplier,pVVar9);
local_c24 = 2.0;
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__mul(&local_1090,&local_c24);
(GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::operator__(pVVar9);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) =
(EntityPtr)Math::timescale_factor(this->_homingFriction,this->_speedMultiplier);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x4))) = extraout_var_14;
local_c20 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)auVar31)) + 0x0)));
(GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector::operator_mul_assign(GHIDRA_CAST<float *>(&local_c20));
}
}
else {
local_88c = (EntityPtr)GetRootPlayer(this);
local_8c8 = &this->_sprite;
_empty_check_0x34();
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar32)) + 0x4))) = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x4)));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar32)) + 0x0))) = GHIDRA_CAST<BitSet128 *>((((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) * 360.0) / (float)local_8fc + 90.0));
local_8c4 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar32)) + 0x0)));
if (local_88c == (EntityPtr)0x0) {
local_8c0 = (EntityPtr)zeroConst;
}
else {
FUN_00665c00();
local_8c0 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar32)) + 0x0)));
}
local_8a1 = '\0';
pBVar6 = BitSet128::operator_and(&fetusTechxMask,&this->_tearFlags,&g_tearFlagFetusTechx);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
iVar7 = EntityPtr::Ref();
if ((iVar7 == 0) && (this->_dead == 0)) {
uVar10 = Random();
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(local_88c);
local_8a0 = (EntityPtr)
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(7,2,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(local_88c),3,uVar10,
1);
if (local_8a0 == (EntityPtr)0x0) {
(GHIDRA_CAST<BitSet128 *>((&g_tearFlagFetusTechx)))->BitSet128::__bnot(&notFetusTechx);
FUN_005cd430();
}
else {
if (local_88c != (EntityPtr)0x0) {
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(local_8a0) + 0x3c);
(GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(local_88c))))->Entity_Player::get_laser_color_copy(&local_514);
(*pcVar1)();
}
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_8a0))))->Entity::SetPositionOffset(&this->_posOffset);
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_8a0))))->Entity::SetParent(GHIDRA_CAST<Entity *>(this));
set_field_358((void *)local_8a0,3000.0);
pBVar8 = &g_tearFlagFetus;
pBVar6 = BitSet128::operator_or(&withShrink,&g_tearFlagGrow,&g_tearFlagShrink);
pBVar6 = BitSet128::operator_or(&orResult5,pBVar6,pBVar8);
pBVar6 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::__bnot(&notResult2);
pBVar6 = BitSet128::operator_and(&andResult10,&this->_tearFlags,pBVar6);
in_stack_ffffd9fc = *GHIDRA_CAST<Vector **>(&pBVar6->_l);
FUN_00456830();
(**(code **)(*GHIDRA_CAST<int *>(local_8a0) + 0x40))();
(GHIDRA_CAST<Entity_Laser *>((GHIDRA_CAST<Entity_Laser *>(local_8a0))))->Entity_Laser::SetTimeout();
(GHIDRA_CAST<Entity_Laser *>((GHIDRA_CAST<Entity_Laser *>(local_8a0))))->Entity_Laser::set_scale(this->_fScale * local_8ec);
FUN_0060ce80();
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_8a0))))->Entity::SetSpawnerEntity(GHIDRA_CAST<Entity *>(local_88c));
(**(code **)(*GHIDRA_CAST<int *>(local_8a0) + 0xc))();
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4a4)))))))->EntityPtr::Set(GHIDRA_CAST<Entity *>(local_8a0));
}
}
iVar7 = EntityPtr::Ref();
if (iVar7 != 0) {
laser = GHIDRA_CAST<Entity_Laser *>(EntityPtr)::Ref();
(GHIDRA_CAST<Entity_Laser *>((laser)))->Entity_Laser::set_scale(this->_fScale * local_8ec);
EntityPtr::Ref();
FUN_0060ce80();
}
}
pBVar6 = BitSet128::operator_and(&fetusSwordMask,&this->_tearFlags,&g_tearFlagFetusSword);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 == 0) {
pBVar6 = BitSet128::operator_and(&fetusKnifeMask,&this->_tearFlags,&g_tearFlagFetusKnife);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 == 0) {
pBVar6 = BitSet128::operator_and(&fetusBoneMask,&this->_tearFlags,&g_tearFlagFetusBone);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
local_87c = (EntityPtr)&this->_attachedEffect;
iVar7 = EntityPtr::Ref();
if ((iVar7 == 0) && (this->_dead == 0)) {
uVar10 = Random();
in_stack_ffffd9fc = &g_vectorZero;
EVar14 = (EntityPtr)
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(8,1,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(local_88c),0,uVar10);
local_8b4 = EVar14;
if (EVar14 != (EntityPtr)0x0) {
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::SetParent(GHIDRA_CAST<Entity *>(this));
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x3c);
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::Color();
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0xffffffff);
(*pcVar1)();
pBVar6 = BitSet128::operator_or(&withShrink2,&g_tearFlagGrow,&g_tearFlagShrink);
pBVar6 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::__bnot(&notResult3);
BitSet128::operator_and(&andResult11,&this->_tearFlags,pBVar6);
EVar14 = local_8b4;
FUN_005cd5c0();
(**(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x40))();
FUN_0060cf20();
local_a68 = this->_fScale * pointSixConst;
pVVar9 = Vector::operator_mul(&uniformScale5,&local_a68,&g_vectorOne);
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::SetSpriteScale(pVVar9);
(**(code **)(*GHIDRA_CAST<int *>(EVar14) + 0xc))();
FUN_00651a10();
}
}
iVar7 = EntityPtr::Ref();
if (iVar7 != 0) {
pEVar11 = GHIDRA_CAST<Entity *>(EntityPtr)::Ref();
this = tear;
pVVar9 = (GHIDRA_CAST<Vector *>((&local_f30)))->Vector::Vector(zeroConst,6.0);
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__mul(&local_f38,&this->_fScale);
pVVar9 = (GHIDRA_CAST<Vector *>((&this->_posOffset)))->Vector::__add(&local_f40,pVVar9);
(GHIDRA_CAST<Entity *>((pEVar11)))->Entity::SetPositionOffset(pVVar9);
EntityPtr::Ref();
FUN_005b15d0();
EntityPtr::Ref();
cVar5 = FUN_00665ba0();
if (cVar5 == '\0') {
Vector::FromAngle(&facingDir,(float)local_8c4);
if (this->_target != (EntityPtr)0x0) {
pVVar9 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this->_target))))->Entity::Position(&targetPos2);
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__sub(&local_f50,&this->_pos);
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::Normalized(&direction5);
local_87c = (EntityPtr)(GHIDRA_CAST<Vector *>((pVVar9)))->Vector::Dot(&facingDir);
if (0.1 < (float)local_87c) {
pVVar9 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this->_target))))->Entity::Position(&targetPos3);
local_87c = (EntityPtr)(GHIDRA_CAST<Vector *>((pVVar9)))->Vector::Distance(&this->_pos);
if ((float)local_87c < this->_fScale * 50.0) {
pEVar11 = GHIDRA_CAST<Entity *>(EntityPtr)::Ref();
pfVar16 = GHIDRA_CAST<float *>((GHIDRA_CAST<Entity *>((pEVar11)))->Entity)::SpriteScale();
local_a70 = 0x3f000000;
local_a6c = oneConst / (*pfVar16 * halfConst + halfConst);
pEVar19 = GHIDRA_CAST<EntityPtr *>(std)::max<float>();
local_87c = *pEVar19;
fVar27 = random_float();
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0xfc);
SoundEffects::PlayWithFartOverride
(0xfc,oneConst,1,0,(fVar27 * 0.2 + 0.9) * (float)local_87c);
EntityPtr::Ref();
FUN_00665bc0();
knife = GHIDRA_CAST<Entity_Knife *>(EntityPtr)::Ref();
(GHIDRA_CAST<Entity_Knife *>((knife)))->Entity_Knife::SetAttackAnimation();
local_8a1 = '\x01';
goto LAB_0066b8aa;
}
}
}
}
local_8a1 = '\x01';
}
}
}
else {
local_87c = (EntityPtr)&this->_attachedEffect;
iVar7 = EntityPtr::Ref();
if ((iVar7 == 0) && (this->_dead == 0)) {
uVar10 = Random();
in_stack_ffffd9fc = &g_vectorZero;
EVar14 = (EntityPtr)
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(8,0,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(local_88c),0,uVar10);
local_8b4 = EVar14;
if (EVar14 != (EntityPtr)0x0) {
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::SetParent(GHIDRA_CAST<Entity *>(this));
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x3c);
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::Color();
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0xffffffff);
(*pcVar1)();
pBVar6 = BitSet128::operator_or(&withShrink3,&g_tearFlagGrow,&g_tearFlagShrink);
pBVar6 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::__bnot(&notResult4);
BitSet128::operator_and(&andResult12,&this->_tearFlags,pBVar6);
EVar14 = local_8b4;
FUN_005cd5c0();
(**(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x40))();
FUN_0060cf20();
local_a60 = this->_fScale * halfConst;
pVVar9 = Vector::operator_mul(&uniformScale6,&local_a60,&g_vectorOne);
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::SetSpriteScale(pVVar9);
(**(code **)(*GHIDRA_CAST<int *>(EVar14) + 0xc))();
FUN_00651a10();
}
}
iVar7 = EntityPtr::Ref();
if (iVar7 != 0) {
piVar12 = GHIDRA_CAST<int *>(EntityPtr)::Ref();
(**(code **)(*piVar12 + 0x40))();
pEVar11 = GHIDRA_CAST<Entity *>(EntityPtr)::Ref();
local_a64 = this->_fScale * halfConst;
pVVar9 = Vector::operator_mul(&uniformScale7,&local_a64,&g_vectorOne);
(GHIDRA_CAST<Entity *>((pEVar11)))->Entity::SetSpriteScale(pVVar9);
pEVar11 = GHIDRA_CAST<Entity *>(EntityPtr)::Ref();
this = tear;
pVVar9 = (GHIDRA_CAST<Vector *>((&local_f10)))->Vector::Vector(zeroConst,4.0);
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__mul(&local_f18,&this->_fScale);
pVVar9 = (GHIDRA_CAST<Vector *>((&this->_posOffset)))->Vector::__add(&local_f20,pVVar9);
(GHIDRA_CAST<Entity *>((pEVar11)))->Entity::SetPositionOffset(pVVar9);
EntityPtr::Ref();
FUN_005b15d0();
}
}
}
else {
local_87c = (EntityPtr)&this->_attachedEffect;
iVar7 = EntityPtr::Ref();
if ((iVar7 == 0) && (this->_dead == 0)) {
uVar10 = 10;
pBVar6 = BitSet128::operator_and(&fetusTechMask,&this->_tearFlags,&g_tearFlagFetusTech);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
uVar10 = 0xb;
}
uVar18 = Random();
in_stack_ffffd9fc = &g_vectorZero;
EVar14 = (EntityPtr)
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(8,uVar10,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(local_88c),0,uVar18)
;
local_8b4 = EVar14;
if (EVar14 == (EntityPtr)0x0) {
KAGE_LogMessage(8,GHIDRA_CAST<byte *>("BAD THINGS! \n"));
}
else {
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::SetParent(GHIDRA_CAST<Entity *>(this));
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x3c);
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::Color();
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0xffffffff);
(*pcVar1)();
pBVar6 = BitSet128::operator_or(&withShrink4,&g_tearFlagGrow,&g_tearFlagShrink);
pBVar6 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::__bnot(&notResult5);
BitSet128::operator_and(&andResult13,&this->_tearFlags,pBVar6);
EVar14 = local_8b4;
FUN_005cd5c0();
(**(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x40))();
FUN_0060cf20();
local_a50 = this->_fScale * pointSixConst;
pVVar9 = Vector::operator_mul(&uniformScale8,&local_a50,&g_vectorOne);
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::SetSpriteScale(pVVar9);
(**(code **)(*GHIDRA_CAST<int *>(EVar14) + 0xc))();
FUN_00651a10();
EntityPtr::Ref();
FUN_005b15d0();
}
}
iVar7 = EntityPtr::Ref();
if (iVar7 != 0) {
piVar12 = GHIDRA_CAST<int *>(EntityPtr)::Ref();
(**(code **)(*piVar12 + 0x40))();
pEVar11 = GHIDRA_CAST<Entity *>(EntityPtr)::Ref();
local_a54 = this->_fScale * pointSixConst;
pVVar9 = Vector::operator_mul(&uniformScale9,&local_a54,&g_vectorOne);
(GHIDRA_CAST<Entity *>((pEVar11)))->Entity::SetSpriteScale(pVVar9);
pEVar11 = GHIDRA_CAST<Entity *>(EntityPtr)::Ref();
spawnedTear = tear;
pVVar9 = (GHIDRA_CAST<Vector *>((&local_ee0)))->Vector::Vector(zeroConst,6.0);
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__mul(&local_ee8,&spawnedTear->_fScale);
pVVar9 = (GHIDRA_CAST<Vector *>((&spawnedTear->_posOffset)))->Vector::__add(&local_ef0,pVVar9);
(GHIDRA_CAST<Entity *>((pEVar11)))->Entity::SetPositionOffset(pVVar9);
pBVar6 = local_8c4;
Vector::FromAngle(&angleDir2,(float)local_8c4);
EntityPtr::Ref();
FUN_0060ccf0();
if ((float)pBVar6 <= 1.1) {
EntityPtr::Ref();
cVar5 = FUN_00665bb0();
if (cVar5 == '\0') {
EntityPtr::Ref();
cVar5 = FUN_00665ba0();
if (cVar5 == '\0') {
pEVar11 = GHIDRA_CAST<Entity *>(EntityPtr)::Ref();
pfVar16 = GHIDRA_CAST<float *>((GHIDRA_CAST<Entity *>((pEVar11)))->Entity)::SpriteScale();
local_a5c = 0x3f000000;
local_a58 = oneConst / (*pfVar16 * halfConst + halfConst);
pEVar19 = GHIDRA_CAST<EntityPtr *>(std)::max<float>();
local_87c = *pEVar19;
fVar27 = random_float();
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0xfc);
SoundEffects::PlayWithFartOverride
(0xfc,oneConst,1,0,(fVar27 * 0.2 + 0.9) * (float)local_87c);
EntityPtr::Ref();
FUN_00665bc0();
knife = GHIDRA_CAST<Entity_Knife *>(EntityPtr)::Ref();
(GHIDRA_CAST<Entity_Knife *>((knife)))->Entity_Knife::SetAttackAnimation();
}
}
else {
EntityPtr::Ref();
EntityPtr::Ref();
FUN_0060ccf0();
FUN_00665be0();
EntityPtr::Ref();
EntityPtr::Ref();
FUN_0060ccf0();
FUN_00665bf0();
}
}
else {
knife = GHIDRA_CAST<Entity_Knife *>(EntityPtr)::Ref();
(GHIDRA_CAST<Entity_Knife *>((knife)))->Entity_Knife::SpinAttack(1,0);
iVar7 = EntityPtr::Ref();
if (iVar7 != 0) {
EntityPtr::Ref();
FUN_00665be0();
EntityPtr::Ref();
FUN_00665bf0();
}
}
iVar7 = EntityPtr::Ref();
if (iVar7 != 0) {
knife = GHIDRA_CAST<Entity_Knife *>(EntityPtr)::Ref();
cVar5 = (GHIDRA_CAST<Entity_Knife *>((knife)))->Entity_Knife::IsFlying();
if (cVar5 == '\0') {
EntityPtr::Ref();
cVar5 = FUN_00665ba0();
if (cVar5 == '\0') {
EntityPtr::Ref();
cVar5 = FUN_00665bb0();
if (cVar5 == '\0') {
piVar12 = GHIDRA_CAST<int *>(EntityPtr)::Ref();
(**(code **)(*piVar12 + 0x28))();
}
}
}
}
iVar7 = EntityPtr::Ref();
if (iVar7 != 0) {
pEVar11 = GHIDRA_CAST<Entity *>(EntityPtr)::Ref();
cVar5 = (GHIDRA_CAST<Entity *>((pEVar11)))->Entity::Exists();
if (cVar5 != '\0') {
_MaxCount = 4;
uVar37 = 0xe8;
uVar38 = 2;
uVar39 = 0xb6;
pEVar11 = GHIDRA_CAST<Entity *>(EntityPtr)::Ref();
(GHIDRA_CAST<Entity *>((pEVar11)))->Entity::GetSprite();
Config::GetPillEffects();
_Str1 = GHIDRA_CAST<char *>(_string_holder_c_str());
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0x66b80b);
iVar7 = strncmp(_Str1,GHIDRA_CAST<char *>(CONCAT22(uVar39,CONCAT11(uVar38,uVar37))),_MaxCount);
if (iVar7 == 0) {
pEVar11 = GHIDRA_CAST<Entity *>(EntityPtr)::Ref();
(GHIDRA_CAST<Entity *>((pEVar11)))->Entity::GetNullOffset(&nullOffset,&DAT_00b1d3b0);
animState = GHIDRA_CAST<AnimationState *>(Config)::GetPillEffects();
iVar7 = (GHIDRA_CAST<AnimationState *>((animState)))->AnimationState::GetAnimationLength();
local_8ac = (EntityPtr)(360.0 / (float)iVar7);
local_87c = (EntityPtr)(GHIDRA_CAST<Vector *>((&nullOffset)))->Vector::GetAngleDegrees();
normalize_angle_degrees((float)local_87c);
FUN_0040a740();
}
else {
EntityPtr::Ref();
FUN_005b15d0();
}
}
}
this = tear;
}
}
LAB_0066b8aa:
pBVar6 = BitSet128::operator_and(&fetusTechMask2,&this->_tearFlags,&g_tearFlagFetusTech);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4a8)))) < 1) {
Vector::FromAngle(&fetusTechFacing,(float)local_8c4);
local_8b4 = (EntityPtr)0x0;
local_898 = (EntityPtr)&DAT_bf800000;
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0x66bfad);
EntityList::QueryRadius(entityList,GHIDRA_CAST<EntityList_EL *>(fetusTechQuery),&this->_pos,140.0,8);
ehState = 1;
local_89c = (EntityPtr)0x0;
iVar7 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(fetusTechQuery))))->EntityList::Size();
if (iVar7 != 0) {
do {
pEVar19 = GHIDRA_CAST<EntityPtr *>(std)::vector<int>::operator_index();
local_888 = *pEVar19;
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_888))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
if (bVar4 != 0) {
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_888))))->Entity::HasEntityFlags(0x20000010);
if (bVar4 == 0) {
if (this->_entityGridCollisionClass == 4) {
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
pVVar9 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_888))))->Entity::Position(&entityPos9);
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0x0);
bVar4 = (GHIDRA_CAST<Room *>((room)))->Room::CheckLine(&this->_pos,pVVar9,3,0,0,0,GHIDRA_CAST<Vector *>(0x0));
if (bVar4 == 0) goto LAB_0066c0c5;
}
pVVar9 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_888))))->Entity::Position(&entityPos10);
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__sub(&local_f78,&this->_pos);
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::Normalized(&direction6);
local_87c = (EntityPtr)(GHIDRA_CAST<Vector *>((pVVar9)))->Vector::Dot(&fetusTechFacing);
if ((float)local_898 < (float)local_87c) {
local_8b4 = local_888;
local_898 = local_87c;
}
}
}
LAB_0066c0c5:
local_89c = (EntityPtr)(GHIDRA_INT(local_89c) + 1);
EVar14 = (EntityPtr)(GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(fetusTechQuery))))->EntityList::Size();
} while (GHIDRA_UINT(local_89c) < GHIDRA_UINT(EVar14));
if ((0.85 < (float)local_898) && (local_8b4 != (EntityPtr)0x0)) {
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4a8)))) = 8;
pVVar9 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_8b4))))->Entity::Position(&entityPos11);
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__sub(&local_f90,&this->_pos);
(GHIDRA_CAST<Vector *>((pVVar9)))->Vector::Normalized(&fetusTechAimDir);
bVar4 = 1;
uVar37 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_88c)) + 0x0)));
uVar38 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_88c)) + 0x1)));
uVar39 = (*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(&(local_88c)) + 0x2)));
pVVar9 = &this->_posOffset;
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0x3);
fVar27 = (GHIDRA_CAST<Vector *>((&fetusTechAimDir)))->Vector::GetAngleDegrees();
EVar14 = (EntityPtr)
Entity_Laser::ShootAngle
(2,&this->_pos,fVar27,GHIDRA_INT(in_stack_ffffd9fc),pVVar9,
GHIDRA_CAST<Entity *>(CONCAT22(uVar39,CONCAT11(uVar38,uVar37))),bVar4);
local_888 = EVar14;
if (EVar14 != (EntityPtr)0x0) {
(GHIDRA_CAST<Entity_Laser *>((GHIDRA_CAST<Entity_Laser *>(EVar14))))->Entity_Laser::SetOneHit();
FUN_00435f70();
pBVar6 = BitSet128::operator_or(&withShrink5,&g_tearFlagGrow,&g_tearFlagShrink);
pBVar6 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::__bnot(&notResult6);
pBVar6 = BitSet128::operator_and(&andResult14,&this->_tearFlags,pBVar6);
in_stack_ffffd9fc = *GHIDRA_CAST<Vector **>(&pBVar6->_l);
FUN_00456830();
local_a78 = 1;
local_a74 = (EntityPtr)GHIDRA_INT((20.0 - (float)local_8c0));
local_87c = local_a74;
piVar12 = GHIDRA_CAST<int *>(std)::max<int>();
iVar7 = Isaac::Random(*piVar12);
if (iVar7 != 0) {
pBVar8 = &g_tearFlagSpore;
pBVar6 = BitSet128::operator_or(&withBooger,&g_tearFlagSticky,&g_tearFlagBooger);
pBVar6 = BitSet128::operator_or(&orResult6,pBVar6,pBVar8);
pBVar6 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::__bnot(&notResult7);
pBVar8 = TearFlags(GHIDRA_CAST<Entity_Tear *>(local_888),&tearFlagsCopy2);
pBVar6 = BitSet128::operator_and(&andResult15,pBVar8,pBVar6);
EVar14 = local_888;
in_stack_ffffd9fc = *GHIDRA_CAST<Vector **>(&pBVar6->_l);
FUN_00456830();
}
local_a7c = local_87c;
local_a80 = 1;
piVar12 = GHIDRA_CAST<int *>(std)::max<int>();
iVar7 = Isaac::Random(*piVar12);
if (iVar7 != 0) {
pBVar6 = BitSet128::operator_or(&withAbsorb,&g_tearFlagPop,&g_tearFlagAbsorb);
pBVar6 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::__bnot(&notResult8);
pBVar8 = TearFlags(GHIDRA_CAST<Entity_Tear *>(local_888),&tearFlagsCopy3);
pBVar6 = BitSet128::operator_and(&andResult16,pBVar8,pBVar6);
EVar14 = local_888;
in_stack_ffffd9fc = *GHIDRA_CAST<Vector **>(&pBVar6->_l);
FUN_00456830();
}
(**(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x40))();
if ((fetusTechAimDir.y < -0.5) || (fetusTechAimDir.x < -0.5)) {
uVar37 = 0;
uVar39 = 0xc120;
}
else {
uVar37 = 0x80;
uVar39 = 0x453b;
}
set_field_358((void *)EVar14,(float)(GHIDRA_UINT(CONCAT21(uVar39,uVar37)) << 8));
if (local_88c != (EntityPtr)0x0) {
Entity_Player::get_laser_color_copy
(GHIDRA_CAST<Entity_Player *>(local_88c),GHIDRA_CAST<ColorMod *>(local_1d8));
playerEffects = GHIDRA_CAST<Color *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite)::Color();
fVar27 = (GHIDRA_CAST<Color *>((playerEffects)))->Color::A();
(GHIDRA_CAST<Font *>((GHIDRA_CAST<Font *>(local_1d8))))->Font::SetLineHeightModifier(fVar27);
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0xff);
(**(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x3c))();
}
(GHIDRA_CAST<Entity_Laser *>((GHIDRA_CAST<Entity_Laser *>(EVar14))))->Entity_Laser::SetMaxDistance(140.0);
(GHIDRA_CAST<Entity_Laser *>((GHIDRA_CAST<Entity_Laser *>(EVar14))))->Entity_Laser::set_scale(this->_fScale * local_8ec);
(**(code **)(*GHIDRA_CAST<int *>(EVar14) + 0xc))();
}
}
}
ehState = 0xffffffff;
(GHIDRA_CAST<EntityList_Query *>((fetusTechQuery)))->EntityList_Query::~EntityList_Query();
}
else {
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4a8)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4a8)))) + -1;
}
}
fVar27 = Math::clamp(zeroConst,2.0,this->_updateTime / 10.0);
fVar27 = pow(oneConst - fVar27,2.0);
this->_friction = fVar27 * 0.1 + 0.9;
local_a84 = this->_updateTime / 45.0;
local_a88 = 0x3f800000;
pEVar19 = GHIDRA_CAST<EntityPtr *>(std)::min<float>();
local_898 = *pEVar19;
auVar31 = ZEXT416(GHIDRA_UINT(local_898));
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(8,this->_index);
if ((bVar4 != 0) && (this->_stickTarget == (void *)0x0)) {
(GHIDRA_CAST<std::vector *>((&this->_hitList)))->std::vector::clear(0);
}
if ((this->_target == (EntityPtr)0x0) &&
(bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::IsFrame(4,this->_index), bVar4 != 0)) {
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) = ZEXT812(0x4e6e6b28);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0xc))) = 0;
local_888 = (EntityPtr)0x0;
local_8c0 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0)));
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
local_b44 = 5.0;
pVVar9 = Vector::operator_mul(&local_f98,&local_b44,&this->_velocity);
pVVar9 = (GHIDRA_CAST<Vector *>((&this->_pos)))->Vector::__add(&local_fa0,pVVar9);
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0x66c558);
EntityList::QueryRadius(entityList,GHIDRA_CAST<EntityList_EL *>(aheadQuery2),pVVar9,128.0,8);
ehState = 2;
local_8b4 = (EntityPtr)0x0;
iVar7 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(aheadQuery2))))->EntityList::Size();
if (iVar7 != 0) {
do {
pEVar19 = GHIDRA_CAST<EntityPtr *>(std)::vector<int>::operator_index();
EVar14 = *pEVar19;
local_89c = EVar14;
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
if (bVar4 != 0) {
if (this->_spawnerEntity != (EntityPtr)0x0) {
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this->_spawnerEntity))))->Entity::IsDescendantOf(GHIDRA_CAST<Entity *>(EVar14));
if (bVar4 != 0) goto LAB_0066c6d8;
}
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::HasEntityFlags(0x20000010);
if (bVar4 == 0) {
iVar7 = Isaac::Random(2);
if (iVar7 != 0) {
if (this->_entityGridCollisionClass == 4) {
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
pVVar9 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_89c))))->Entity::Position(&entityPos12);
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0x0);
bVar4 = (GHIDRA_CAST<Room *>((room)))->Room::CheckLine(&this->_pos,pVVar9,3,0,0,0,GHIDRA_CAST<Vector *>(0x0));
if (bVar4 == 0) goto LAB_0066c6d8;
}
local_a8c = 5.0;
pVVar9 = Vector::operator_mul(&local_fb0,&local_a8c,&this->_velocity);
pVVar9 = (GHIDRA_CAST<Vector *>((&this->_pos)))->Vector::__add(&local_fb8,pVVar9);
pVVar15 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_89c))))->Entity::Position(&entityPos13);
local_8ac = (EntityPtr)(GHIDRA_CAST<Vector *>((pVVar9)))->Vector::Distance(pVVar15);
fVar27 = random_float();
local_87c = (EntityPtr)(fVar27 * 128.0 + (float)local_8ac);
auVar31 = ZEXT416(GHIDRA_UINT(local_87c));
if ((float)local_87c < (float)local_8c0) {
local_888 = local_89c;
local_8c0 = local_87c;
}
}
}
}
LAB_0066c6d8:
EVar28 = (EntityPtr)(GHIDRA_INT(local_8b4) + 1);
local_8b4 = EVar28;
EVar14 = (EntityPtr)(GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(aheadQuery2))))->EntityList::Size();
} while (GHIDRA_UINT(EVar28) < GHIDRA_UINT(EVar14));
}
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::SetTarget(GHIDRA_CAST<Entity *>(local_888));
ehState = 0xffffffff;
(GHIDRA_CAST<EntityList_Query *>((aheadQuery2)))->EntityList_Query::~EntityList_Query();
}
if (this->_target != (EntityPtr)0x0) {
pVVar9 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this->_target))))->Entity::Position(&targetPos4);
(GHIDRA_CAST<Vector *>((&this->_pos)))->Vector::__sub(&fromTarget2,pVVar9);
pVVar15 = &this->_velocity;
local_8ac = (EntityPtr)pVVar15;
pVVar9 = (GHIDRA_CAST<Vector *>((&fromTarget2)))->Vector::Normalized(&direction7);
local_87c = (EntityPtr)(GHIDRA_CAST<Vector *>((pVVar15)))->Vector::Dot(pVVar9);
local_c44 = ((float)local_87c * 0.1 + 1.35) * (float)local_898;
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar15)))->Vector::Normalized(&direction8);
pVVar15 = (GHIDRA_CAST<Vector *>((&fromTarget2)))->Vector::Normalized(&direction9);
fVar27 = (GHIDRA_CAST<Vector *>((&fromTarget2)))->Vector::Length();
local_a94 = 0;
local_a90 = 0.08 - fVar27 * 0.0005;
fVar27 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::Dot(pVVar15);
local_87c = (EntityPtr)(0.92 - fVar27 * 0.05);
pfVar16 = GHIDRA_CAST<float *>(std)::max<float>();
local_a98 = (float)local_87c + *pfVar16;
local_a9c = 0x3f7ae148;
pfVar16 = GHIDRA_CAST<float *>(std)::min<float>();
local_87c = (EntityPtr)*pfVar16;
pVVar9 = (GHIDRA_CAST<Vector *>((&fromTarget2)))->Vector::Normalized(&direction10);
EVar14 = local_8d0;
pVVar9 = Vector::operator_mul(&local_ff0,GHIDRA_CAST<float *>(local_8d0),pVVar9);
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__mul(&local_ff8,&local_c44);
EVar28 = local_8ac;
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(local_8ac))))->Vector::operator__(pVVar9);
timescaleFactor = (void *)Math::timescale_factor((float)local_87c,*GHIDRA_CAST<float *>(EVar14));
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(EVar28))))->Vector::operator_mul_assign(GHIDRA_CAST<float *>(&timescaleFactor));
local_89c = (EntityPtr)0x40000000;
pBVar6 = BitSet128::operator_and(&homingMask3,tearFlagsPtr,&g_tearFlagHoming);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
local_89c = (EntityPtr)0x41400000;
}
local_89c = (EntityPtr)((float)local_89c * *GHIDRA_CAST<float *>(EVar14));
pVVar9 = (GHIDRA_CAST<Vector *>((&fromTarget2)))->Vector::__unm(&negated2);
local_87c = (EntityPtr)(GHIDRA_CAST<Vector *>((pVVar9)))->Vector::GetAngleDegrees();
local_8ac = (EntityPtr)(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(EVar28))))->Vector::GetAngleDegrees();
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) = (EntityPtr)approach_angle((float)local_8ac,(float)local_87c,(float)local_89c);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x4))) = extraout_var_12;
pVVar9 = Vector::FromAngle(&angleDir3,(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)auVar31)) + 0x0))));
local_c3c = (void *)(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(EVar28))))->Vector::Length();
pVVar9 = Vector::operator_mul(&local_1010,GHIDRA_CAST<float *>(&local_c3c),pVVar9);
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(EVar28))))->Vector::operator_assign(pVVar9);
if ((local_8a1 != '\0') &&
(bVar4 = (GHIDRA_CAST<Vector *>((&fromTarget2)))->Vector::operator_ne(&g_vectorZero), bVar4 != 0)) {
animState = GHIDRA_CAST<AnimationState *>(Config)::GetPillEffects();
iVar7 = (GHIDRA_CAST<AnimationState *>((animState)))->AnimationState::GetAnimationLength();
fVar27 = (float)iVar7;
local_8c0 = (EntityPtr)(360.0 / fVar27);
_empty_check_0x34();
pVVar9 = Vector::FromAngle(&angleDir4,fVar27 * (float)local_8c0);
local_c38 = *GHIDRA_CAST<float *>(local_8d0) * (float)local_8fc;
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0x66ca43);
pVVar15 = Vector::operator_mul(&local_1020,&local_c38,&fromTarget2);
fromTargetLenSq = (GHIDRA_CAST<Vector *>((&fromTarget2)))->Vector::LengthSquared();
pVVar15 = (GHIDRA_CAST<Vector *>((pVVar15)))->Vector::__div(&local_1028,&fromTargetLenSq);
(GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__add(&local_dc8,pVVar15);
local_87c = (EntityPtr)(GHIDRA_CAST<Vector *>((&local_dc8)))->Vector::GetAngleDegrees();
fVar27 = normalize_angle_degrees((float)local_87c);
if (fVar27 < zeroConst) {
fVar27 = fVar27 + 360.0;
}
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) = (EntityPtr)(fVar27 / (float)local_8c0);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x4))) = extraout_var_13;
FUN_0040a740();
}
}
}
LAB_0066d04f:
pBVar6 = tearFlagsPtr;
pBVar8 = BitSet128::operator_and(&occultMask,tearFlagsPtr,&g_tearFlagOccult);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar8)))->BitSet128::IsNonZero();
if (bVar4 == 0) {
LAB_0066d2f2:
EVar14 = (EntityPtr)tear;
}
else {
pBVar8 = BitSet128::operator_and(&ludovicoMask8,pBVar6,&g_tearFlagLudovico);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar8)))->BitSet128::IsZero();
if (bVar4 == 0) goto LAB_0066d2f2;
pBVar8 = BitSet128::operator_and(&fetusMask2,pBVar6,&g_tearFlagFetus);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar8)))->BitSet128::IsZero();
EVar14 = local_8d8;
if ((bVar4 == 0) || (local_8d8 == (EntityPtr)0x0)) goto LAB_0066d2f2;
(GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(local_8d8))))->Entity_Player::ControllerIndex();
aimDir.x = g_vectorZero.x;
aimDir.y = g_vectorZero.y;
EVar28 = (EntityPtr)g_vectorZero.y;
iVar7 = FUN_007826c0();
if (iVar7 == 0) {
pVVar9 = GHIDRA_CAST<Vector *>(FUN_005cd7e0());
(GHIDRA_CAST<Vector *>((&aimDir)))->Vector::operator_assign(pVVar9);
(GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(EVar14))))->Entity_Player::GetMouseAimTarget(&aimDir,0);
}
else {
pEVar11 = GHIDRA_CAST<Entity *>(FUN_007826c0());
pVVar9 = (GHIDRA_CAST<Entity *>((pEVar11)))->Entity::Position(&entityPos14);
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__sub(&local_10a0,tearPos);
local_c1c = 10.0;
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__div(&local_10a8,&local_c1c);
(GHIDRA_CAST<Vector *>((&aimDir)))->Vector::operator_assign(pVVar9);
EVar28 = (EntityPtr)(GHIDRA_CAST<Vector *>((&aimDir)))->Vector::Length();
local_87c = EVar28;
if (oneConst < (float)EVar28) {
(GHIDRA_CAST<Vector *>((&aimDir)))->Vector::Normalize();
}
}
FUN_00436190();
local_914 = (float)EVar28 * (float)local_890;
bVar4 = (GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(EVar14))))->Entity_Player::HasWeaponType(8);
if (bVar4 == 0) {
pBVar8 = BitSet128::operator_and(&boomerangMask2,pBVar6,&g_tearFlagBoomerang);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar8)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
local_914 = local_914 * halfConst;
}
}
else {
local_914 = local_914 * local_900;
}
auVar31 = ZEXT416(GHIDRA_UINT(aimDir.x));
if ((aimDir.x == zeroConst) && (auVar31 = ZEXT416(GHIDRA_UINT(aimDir.y)), aimDir.y == zeroConst)) {
pBVar8 = BitSet128::operator_and(&boomerangMask3,pBVar6,&g_tearFlagBoomerang);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar8)))->BitSet128::IsNonZero();
if (bVar4 == 0) {
pBVar8 = BitSet128::operator_and(&homingMask4,pBVar6,&g_tearFlagHoming);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar8)))->BitSet128::IsNonZero();
EVar14 = (EntityPtr)tear;
if (bVar4 == 0) goto LAB_0066d2e6;
tear->_friction = 0.9;
}
else {
tear->_friction = 1.0;
EVar14 = (EntityPtr)tear;
}
}
else {
(GHIDRA_CAST<Vector *>((&aimDir)))->Vector::Normalize();
pVVar9 = (GHIDRA_CAST<Vector *>((&aimDir)))->Vector::__mul(local_10b8,&local_914);
EVar14 = (EntityPtr)tear;
(GHIDRA_CAST<Vector *>((&tear->_velocity)))->Vector::operator_add_assign(pVVar9);
LAB_0066d2e6:
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(EVar14) + 0x36c)) = 0x3f4ccccd;
}
}
pBVar8 = BitSet128::operator_and(&growMask,pBVar6,&g_tearFlagGrow);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar8)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
pBVar6 = BitSet128::operator_and(&ludovicoMask9,pBVar6,&g_tearFlagLudovico);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 == 0) {
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x438)) < 1) {
fVar27 = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x7ec)))))->Vector::Length();
local_87c = (EntityPtr)(fVar27 * 0.014);
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x388)) = (float)local_87c + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x388));
fVar27 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x424)) + 0.01;
auVar31 = ZEXT416(GHIDRA_UINT(fVar27));
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x424)) = fVar27;
}
}
else {
bVar4 = is_not_familiar_spawned(GHIDRA_CAST<Entity_Tear *>(EVar14));
if (bVar4 != 0) {
pVVar9 = (GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(EVar14) + 0x3bc)))))->Entity::Position(&parentPos);
local_87c = (EntityPtr)(GHIDRA_CAST<Vector *>((pVVar9)))->Vector::Distance(GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x33c)));
fVar27 = Math::clamp(oneConst,700.0,(float)local_87c);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) = (EntityPtr)(fVar27 / 700.0 + oneConst);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x4))) = extraout_var_15;
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x388)) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)auVar31)) + 0x0))) * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x454));
local_8dc = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)auVar31)) + 0x0)));
}
}
}
pBVar6 = BitSet128::operator_and(&shrinkMask,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagShrink)
;
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
pBVar6 = BitSet128::operator_and
(&ludovicoMask10,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagLudovico);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 == 0) {
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x438)) < 1) {
auVar31 = ZEXT416(GHIDRA_UINT(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x3a4))));
if (4.0 < *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x3a4))) {
pBVar6 = BitSet128::operator_and
(&fetusMask3,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagFetus);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
fVar27 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x454));
fVar23 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x388));
if (bVar4 == 0) {
if (fVar27 / (float)local_890 < fVar23) {
decayFactor = 0.08;
}
else {
decayFactor = 0.03;
}
local_c14._capacity = 0x3dcccccd;
local_c14._data = (void *)(fVar23 - decayFactor * fVar27);
}
else {
if (fVar27 / (float)local_890 < fVar23) {
decayFactor = 0.022;
}
else {
decayFactor = 0.006;
}
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_c14)) + 0x0))) = 0x3dcccccd;
local_c18 = fVar23 - decayFactor * fVar27;
}
pfVar16 = GHIDRA_CAST<float *>(std)::max<float>();
fVar27 = *pfVar16;
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x388)) = fVar27;
fVar27 = fVar27 / *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x454));
FUN_00431260();
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) = ZEXT812(0x3dcccccd);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0xc))) = 0;
local_8dc = fVar27;
if (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x388)) <= (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0)))) {
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(EVar14) + 0x173)) = 1;
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(EVar14) + 0x474)) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(EVar14) + 0x474)) | 0x10;
}
}
}
}
else {
bVar4 = is_not_familiar_spawned(GHIDRA_CAST<Entity_Tear *>(EVar14));
if (bVar4 != 0) {
pVVar9 = (GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(EVar14) + 0x3bc)))))->Entity::Position(&parentPos2);
local_87c = (EntityPtr)(GHIDRA_CAST<Vector *>((pVVar9)))->Vector::Distance(GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x33c)));
fVar27 = Math::clamp(zeroConst,900.0,(float)local_87c);
fVar27 = oneConst - fVar27 / 900.0;
local_8dc = fVar27 * local_8dc;
auVar31 = ZEXT416(GHIDRA_UINT(local_8dc));
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x388)) = fVar27 * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x454));
}
}
}
pBVar6 = BitSet128::operator_and
(&spectralMask,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagSpectral);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x2c)) == 4) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x2c)) == 9)) {
uVar20 = 3;
}
else {
uVar20 = 0;
}
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(EVar14) + 0x184)) = uVar20;
pBVar6 = BitSet128::operator_and
(&ludovicoMask11,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagLudovico);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsZero();
if (bVar4 != 0) {
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(EVar14) + 0x46b)) == '\0') {
cVar5 = try_make_bridges();
if (cVar5 != '\0') {
apply_death_flag_effects(GHIDRA_CAST<Entity_Tear *>(EVar14),GHIDRA_CAST<Entity *>(0x0));
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(EVar14) + 0x46b)) = 1;
}
}
else {
iVar7 = Isaac::Random(8);
if (iVar7 == 0) {
try_make_bridges();
}
}
}
}
pBVar6 = BitSet128::operator_and
(&boomerangMask4,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagBoomerang);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if ((bVar4 != 0) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x3bc)) != 0)) {
pBVar8 = &g_tearFlagOrbitAdvanced;
pBVar6 = BitSet128::operator_or(&withOrbit2,&g_tearFlagLudovico,&g_tearFlagOrbit);
pBVar6 = BitSet128::operator_or(&orResult7,pBVar6,pBVar8);
pBVar6 = BitSet128::operator_and(&andResult17,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),pBVar6);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsZero();
if (bVar4 != 0) {
pVVar9 = (GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(EVar14) + 0x3bc)))))->Entity::Position(&parentPos3);
pVVar15 = (GHIDRA_CAST<Vector *>((&local_10d8)))->Vector::Vector(zeroConst,2.0);
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__add(&local_10e0,pVVar15);
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x33c)))))->Vector::__sub(&local_ca8,pVVar9);
bVar4 = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x334)))))->Vector::operator_ne(&g_vectorZero);
if (bVar4 != 0) {
pVVar9 = (GHIDRA_CAST<Vector *>((&local_10e8)))->Vector::Vector(zeroConst,2.0);
pVVar9 = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x334)))))->Vector::__sub(&local_10f0,pVVar9);
pVVar9 = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x33c)))))->Vector::__sub(&local_10f8,pVVar9);
(GHIDRA_CAST<Vector *>((&local_ca8)))->Vector::operator_assign(pVVar9);
}
local_87c = (EntityPtr)GetRootPlayer(GHIDRA_CAST<Entity_Tear *>(EVar14));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_c04)) + 0x0))) = 0x41a00000;
local_c14._size = GHIDRA_INT(((*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x820)) - 60.0) * halfConst));
auVar31 = ZEXT416(GHIDRA_UINT(local_c14._size));
puVar13 = GHIDRA_CAST<undefined4 *>(std)::max<float>();
local_8ac = (EntityPtr)*puVar13;
if (local_87c == (EntityPtr)0x0) {
auVar31 = ZEXT416(GHIDRA_UINT(oneConst));
}
else {
FUN_00436190();
}
fVar27 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) * 10.0;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) = (EntityPtr)((fVar27 * fVar27) / ((float)local_8ac + (float)local_8ac));
local_c04._data = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)auVar31)) + 0x0)));
pVVar9 = (GHIDRA_CAST<Vector *>((&local_ca8)))->Vector::Normalized(&direction11);
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__mul(&local_1108,GHIDRA_CAST<float *>(&local_c04._data));
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x360)))))->Vector::operator__(pVVar9);
}
}
pBVar6 = BitSet128::operator_and(&wiggleMask,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagWiggle)
;
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
if (local_8d8 == (EntityPtr)0x0) {
fVar27 = oneConst;
}
else {
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) = (EntityPtr)get_tear_trinket_multiplier(GHIDRA_CAST<Entity_Player *>(local_8d8),10);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x4))) = extraout_var_16;
local_c04._size = 0x3f800000;
local_c04._capacity = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_INT(auVar31))) + 0x0)));
pfVar16 = GHIDRA_CAST<float *>(std)::max<float>();
fVar27 = *pfVar16;
}
apply_wiggle(GHIDRA_CAST<Entity_Tear *>(EVar14),fVar27);
}
pBVar6 = BitSet128::operator_and(&spiralMask,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagSpiral)
;
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
if (local_8d8 == (EntityPtr)0x0) {
fVar27 = oneConst;
}
else {
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) = (EntityPtr)get_tear_trinket_multiplier(GHIDRA_CAST<Entity_Player *>(local_8d8),0x1a);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x4))) = extraout_var_17;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_bf0)) + 0x0))) = 0x3f800000;
local_bf4 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)auVar31)) + 0x0)));
pfVar16 = GHIDRA_CAST<float *>(std)::max<float>();
fVar27 = *pfVar16;
}
apply_wiggle(GHIDRA_CAST<Entity_Tear *>(EVar14),fVar27);
}
pBVar6 = BitSet128::operator_and
(&bigSpiralMask,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagBigSpiral);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
if (local_8d8 != (EntityPtr)0x0) {
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) = (EntityPtr)get_tear_trinket_multiplier(GHIDRA_CAST<Entity_Player *>(local_8d8),0x2e);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x4))) = extraout_var_18;
local_bf0._capacity = 0x3f800000;
local_bf0._data = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)auVar31)) + 0x0)));
std::max<float>();
}
update_wiggle(GHIDRA_CAST<Entity_Tear *>(EVar14));
}
pBVar6 = BitSet128::operator_and
(&attractorMask2,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagAttractor);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) =
(EntityPtr)Math::clamp(zeroConst,oneConst,(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x3a4)) - 10.0) / 10.0);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x4))) = extraout_var_19;
local_87c = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(EVar14) + 0x478));
local_8d0 = (EntityPtr)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)auVar31)) + 0x0))) * 20.0 * (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)auVar31)) + 0x0))));
if (local_87c != (EntityPtr)0x0) {
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) = ZEXT812(0x41000000);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0xc))) = 0;
local_8d0 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0)));
}
local_bf0._size = 0x40800000;
pVVar9 = Vector::operator_mul
(&local_1110,GHIDRA_CAST<float *>(&local_bf0._size),GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x360)));
pVVar9 = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x33c)))))->Vector::__add(&local_1118,pVVar9);
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0x66dae1);
Game::AttractEntities
(g_game,pVVar9,Entity_Effect::rift_attract_filter,(void *)local_87c,(float)local_8d0,
250.0);
}
pBVar6 = GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428));
pBVar8 = BitSet128::operator_and(&pulseMask,pBVar6,&g_tearFlagPulse);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar8)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
if (local_8d8 == (EntityPtr)0x0) {
fVar27 = oneConst;
}
else {
local_ba0 = get_tear_trinket_multiplier(GHIDRA_CAST<Entity_Player *>(local_8d8),0x19);
local_be0 = (void *)0x3f800000;
pfVar16 = GHIDRA_CAST<float *>(std)::max<float>();
fVar27 = *pfVar16;
}
local_8d0 = (EntityPtr)(fVar27 * pointThreeConst);
auVar31 = ZEXT416(GHIDRA_UINT(local_8d0));
pBVar8 = BitSet128::operator_and(&ludovicoMask12,pBVar6,&g_tearFlagLudovico);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar8)))->BitSet128::IsNonZero();
if (bVar4 == 0) {
iVar7 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::FrameCount();
fVar27 = sinf_wrapper((float)iVar7 * 0.7);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) = (EntityPtr)((fVar27 + 0.7) * (float)local_8d0 + pointSixConst);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x4))) = extraout_var_21;
local_8dc = local_8dc * (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)auVar31)) + 0x0)));
}
else if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x3bc)) != 0) && (iVar7 = (GHIDRA_CAST<Entity *>(()))->Entity::Type(), iVar7 == 1)) {
iVar7 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::FrameCount();
fVar27 = sinf_wrapper((float)iVar7 * 0.2);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) = (EntityPtr)((fVar27 + 0.2) * (float)local_8d0 + 1.1);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x4))) = extraout_var_20;
local_8dc = local_8dc * (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)auVar31)) + 0x0)));
}
}
local_8b4 = (EntityPtr)local_8dc;
pBVar8 = BitSet128::operator_and(&stickyMask,pBVar6,&g_tearFlagSticky);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar8)))->BitSet128::IsNonZero();
if (bVar4 == 0) {
pBVar8 = BitSet128::operator_and(&sporeMask,pBVar6,&g_tearFlagSpore);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar8)))->BitSet128::IsNonZero();
if (bVar4 != 0) goto LAB_0066dc7d;
}
else {
LAB_0066dc7d:
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x478)) != 0) && (0 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x484)))) {
fVar27 = oneConst - (float)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x484)) / 60.0;
local_8dc = local_8dc + fVar27 + fVar27;
auVar31 = ZEXT416(GHIDRA_UINT(local_8dc));
}
}
local_8a0 = (EntityPtr)(GHIDRA_INT(EVar14) + 0x48);
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(local_8a0))))->Sprite::SetRotation(0.0);
local_87c = (EntityPtr)(GHIDRA_INT(EVar14) + 0x5c0);
local_8b9 = '\0';
cVar5 = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(local_87c))))->Sprite::IsLoaded();
if (cVar5 == '\0') {
LAB_0066dd14:
local_8a1 = 0;
}
else {
cVar5 = _has_flag_0x110();
local_8a1 = 1;
if (cVar5 == '\0') goto LAB_0066dd14;
}
pBVar8 = BitSet128::operator_and(&flatMask,pBVar6,&g_tearFlagFlat);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar8)))->BitSet128::IsNonZero();
if ((bVar4 != 0) && (iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x2c)), iVar7 != 4)) {
if (local_8d8 == (EntityPtr)0x0) {
fVar27 = oneConst;
}
else {
local_bdc = get_tear_trinket_multiplier(GHIDRA_CAST<Entity_Player *>(local_8d8),0x1b);
local_bd8 = 0x3f800000;
pfVar16 = GHIDRA_CAST<float *>(std)::max<float>();
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x2c));
fVar27 = *pfVar16;
}
fVar27 = fVar27 * halfConst + oneConst;
auVar31 = ZEXT416(GHIDRA_UINT(fVar27));
if (iVar7 == 0x32) {
pVVar9 = (GHIDRA_CAST<Vector *>((&local_1120)))->Vector::Vector(fVar27,oneConst);
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x374)))))->Vector::operator_assign(pVVar9);
}
else {
pVVar9 = (GHIDRA_CAST<Vector *>((&local_1128)))->Vector::Vector(oneConst,fVar27);
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x374)))))->Vector::operator_assign(pVVar9);
local_8b9 = '\x01';
}
}
if (((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x2c)) == 0xd) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x2c)) == 0x17)) &&
(bVar4 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsInTimedSet(0x4f), bVar4 != 0)) {
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(EVar14) + 0x374)) = 0x40400000;
}
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x2c));
if ((iVar7 == 0xe) || (iVar7 == 0xf)) {
pBVar6 = BitSet128::operator_and(&boomerangMask5,pBVar6,&g_tearFlagBoomerang);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 == 0) {
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x2c));
goto LAB_0066de6b;
}
fVar27 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x3a4)) * 45.0;
auVar31 = ZEXT416(GHIDRA_UINT(fVar27));
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(EVar14) + 0x48)))))->Sprite::SetRotation(fVar27);
local_8b9 = '\0';
}
else {
LAB_0066de6b:
if (((((iVar7 == 0xb) || (iVar7 == 0xc)) ||
((iVar7 == 0xd || (((iVar7 == 0xe || (iVar7 == 0xf)) || (iVar7 == 0x17)))))) ||
((iVar7 == 0x1f || (iVar7 == 0x21)))) ||
((iVar7 == 0x22 ||
(((iVar7 == 0x14 || (iVar7 == 0x27)) ||
((iVar7 == 0x29 ||
((((iVar7 == 0x2b || (iVar7 == 0x2c)) || (iVar7 == 0x2d)) ||
((iVar7 == 0x2f || (iVar7 == 0x31)))))))))))) {
local_8b9 = '\x01';
}
}
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x2c)) == 0x32) {
fVar27 = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x360)))))->Vector::Length();
local_8d0 = (EntityPtr)(fVar27 + fVar27);
if (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x360)) <= zeroConst && zeroConst != *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x360))
) {
local_8d0 = (EntityPtr)((float)local_8d0 * -1.0);
}
animState = GHIDRA_CAST<AnimationState *>(Config)::GetPillEffects();
iVar7 = (GHIDRA_CAST<AnimationState *>((animState)))->AnimationState::GetAnimationLength();
fVar27 = (float)iVar7;
local_8c0 = (EntityPtr)(360.0 / fVar27);
_empty_check_0x34();
fVar27 = normalize_angle_degrees
(fVar27 * (float)local_8c0 +
(float)local_8d0 * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x39c)));
if (fVar27 < zeroConst) {
fVar27 = fVar27 + 360.0;
}
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) = (EntityPtr)(fVar27 / (float)local_8c0);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x4))) = extraout_var_22;
FUN_0040a740();
}
if ((local_8b9 != '\0') || (local_8a1 != 0)) {
local_9c4.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x360));
local_8ac = (EntityPtr)(GHIDRA_INT(EVar14) + 0x360);
local_9c4.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x364));
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x438)) < 1) {
auVar31 = ZEXT416(GHIDRA_UINT(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x418))));
if (0.001 < *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x418))) {
LAB_0066e037:
pVVar9 = (GHIDRA_CAST<Vector *>((&local_1130)))->Vector::Vector(zeroConst,(float)local_8e0);
(GHIDRA_CAST<Vector *>((&local_9c4)))->Vector::operator_add_assign(pVVar9);
}
else {
pBVar6 = BitSet128::operator_and
(&ludovicoMask13,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagLudovico);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
pBVar6 = BitSet128::operator_and
(&hydrobounceMask4,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),
&g_tearFlagHydrobounce);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 != 0) goto LAB_0066e037;
}
}
}
else {
(GHIDRA_CAST<Vector *>((&local_9c4)))->Vector::operator_assign(GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x43c)));
}
local_89c = (EntityPtr)(GHIDRA_CAST<Vector *>((&local_9c4)))->Vector::GetAngleDegrees();
if (local_8b9 != '\0') {
auVar31 = ZEXT416(GHIDRA_UINT(local_89c));
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(EVar14) + 0x48)))))->Sprite::SetRotation((float)local_89c);
}
if (local_8a1 != 0) {
layerIndex = GHIDRA_CAST<byte *>(0x0);
iVar7 = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(EVar14) + 0x5c0)))))->Sprite::GetLayerCount();
EVar28 = local_87c;
if (iVar7 != 0) {
do {
layer = (GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(EVar28))))->Sprite::GetLayer(layerIndex);
if ((layer->_bitflags & 0x1000U) != 0) {
auVar31 = ZEXT416(GHIDRA_UINT(local_89c));
layer->_rotation = (float)local_89c;
}
layerIndex = layerIndex + 1;
layerCount = GHIDRA_CAST<byte *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(EVar28))))->Sprite)::GetLayerCount();
} while (layerIndex < layerCount);
EVar14 = (EntityPtr)tear;
}
}
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x2c)) == 0x17) {
seeds = GHIDRA_CAST<Seeds *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetSeeds();
bVar4 = (GHIDRA_CAST<Seeds *>((seeds)))->Seeds::HasSeedEffect(0x4f);
if (((bVar4 != 0) &&
(iVar7 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::GetIntervalTicks(2.0,zeroConst), iVar7 != 0)) &&
(*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(EVar14) + 0x171)) != '\0')) {
uVar10 = Random();
local_bd4 = 0.14;
pVVar9 = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(local_8ac))))->Vector::__mul(&local_1138,&local_bd4);
pVVar15 = Vector::FromAngle(&angleDir5,(float)local_89c);
local_bd0 = (void *)0x40a00000;
pVVar15 = Vector::operator_mul(&local_1148,GHIDRA_CAST<float *>(&local_bd0),pVVar15);
pVVar15 = (GHIDRA_CAST<Vector *>((pVVar15)))->Vector::__mul(&local_1150,&tear->_fScale);
pVVar15 = (GHIDRA_CAST<Vector *>((tearPos)))->Vector::__sub(&local_1158,pVVar15);
effect = (Entity_Effect *)
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x3b,pVVar15,pVVar9,GHIDRA_CAST<Entity *>(0x0),0,uVar10);
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(effect) + 0x3c);
(GHIDRA_CAST<Color *>((local_4e8)))->Color::Color(oneConst,oneConst,oneConst,0.3);
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0xffffffff);
(*pcVar1)();
fVar27 = random_float();
(GHIDRA_CAST<Entity_Effect *>((effect)))->Entity_Effect::set_rotation(fVar27 * 10.0 + 2.0);
iVar7 = Isaac::Random(0xf);
(GHIDRA_CAST<Entity_Effect *>((effect)))->Entity_Effect::SetTimeout(iVar7 + 0xf);
EVar14 = (EntityPtr)tear;
local_bcc = tear->_fScale * local_900;
auVar31 = ZEXT416(GHIDRA_UINT(local_bcc));
pVVar9 = Vector::operator_mul(&uniformScale10,&local_bcc,&g_vectorOne);
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(effect))))->Entity::SetSpriteScale(pVVar9);
set_field_358(effect,-18.0);
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(effect))))->Entity::SetPositionOffset(&(GHIDRA_CAST<Entity_Tear *>(EVar14))->_posOffset);
}
}
}
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x2c));
if ((((iVar7 == 0x23) || (iVar7 == 0x25)) || (iVar7 == 0x26)) &&
(bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::IsFrame(2,0), bVar4 != 0)) {
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x2c)) == 0x26) {
local_87c = (EntityPtr)Random();
local_bc8 = 0.3;
pVVar9 = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x360)))))->Vector::__mul(&local_1168,&local_bc8);
pVVar15 = MusicManager::RandomVector(&randomDir2);
local_bc4 = random_float();
pVVar15 = (GHIDRA_CAST<Vector *>((pVVar15)))->Vector::__mul(&local_1178,&local_bc4);
local_bc0 = (void *)0x40400000;
pVVar15 = (GHIDRA_CAST<Vector *>((pVVar15)))->Vector::__mul(&local_1180,GHIDRA_CAST<float *>(&local_bc0));
pfVar16 = &tear->_fScale;
pVVar15 = (GHIDRA_CAST<Vector *>((pVVar15)))->Vector::__mul(&local_1188,pfVar16);
in_stack_ffffd9fc = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__add(&local_1190,pVVar15);
local_89c = (EntityPtr)
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x58,tearPos,in_stack_ffffd9fc,GHIDRA_CAST<Entity *>(0x0),0,
GHIDRA_UINT(local_87c));
sprite = GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_89c))))->Entity)::GetSprite();
pVVar9 = (GHIDRA_CAST<Vector *>((&g_vectorOne)))->Vector::__mul(&uniformScale11,pfVar16);
local_bbc = 0.8;
pVVar15 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__mul(&local_11a0,&local_bbc);
fVar27 = random_float();
pfVar16 = &local_bb4;
pVVar9 = &local_11a8;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) = (EntityPtr)(fVar27 * pointSixConst + pointSixConst);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x4))) = extraout_var_23;
local_bb4 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)auVar31)) + 0x0)));
}
else {
local_87c = (EntityPtr)Random();
local_bb0 = 0.3;
pVVar9 = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x360)))))->Vector::__mul(&local_11b0,&local_bb0);
pVVar15 = MusicManager::RandomVector(&randomDir3);
local_bac = random_float();
pVVar15 = (GHIDRA_CAST<Vector *>((pVVar15)))->Vector::__mul(&local_11c0,&local_bac);
local_ba8 = 3.0;
pVVar15 = (GHIDRA_CAST<Vector *>((pVVar15)))->Vector::__mul(&local_11c8,&local_ba8);
pVVar15 = (GHIDRA_CAST<Vector *>((pVVar15)))->Vector::__mul(&local_11d0,&tear->_fScale);
in_stack_ffffd9fc = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__add(&local_11d8,pVVar15);
EVar14 = (EntityPtr)
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x6f,tearPos,in_stack_ffffd9fc,GHIDRA_CAST<Entity *>(0x0),0,
GHIDRA_UINT(local_87c));
local_89c = EVar14;
pAVar22 = GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity)::GetSprite();
fVar27 = random_float();
set_PlaybackSpeed(pAVar22,fVar27 * pointSixConst + halfConst);
sprite = GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity)::GetSprite();
pVVar9 = (GHIDRA_CAST<Vector *>((&g_vectorOne)))->Vector::__mul(&uniformScale12,&tear->_fScale);
local_ba4 = 0.5;
pVVar15 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__mul(&local_11e8,&local_ba4);
fVar27 = random_float();
pfVar16 = &local_b98;
pVVar9 = &local_11f0;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) = (EntityPtr)(fVar27 * pointSixConst + pointSixConst);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x4))) = extraout_var_24;
local_b98 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)auVar31)) + 0x0)));
}
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar15)))->Vector::__mul(pVVar9,pfVar16);
(GHIDRA_CAST<Sprite *>((sprite)))->Sprite::SetScale(pVVar9);
EVar14 = (EntityPtr)tear;
EVar28 = local_89c;
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_89c))))->Entity::SetPositionOffset(&tear->_posOffset);
FUN_00440e90();
sprite = GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar28))))->Entity)::GetSprite();
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&(GHIDRA_CAST<Entity_Tear *>(EVar14))->_sprite))))->Sprite)::Color();
(GHIDRA_CAST<Sprite *>((sprite)))->Sprite::SetColor(color);
(**(code **)(*GHIDRA_CAST<int *>(local_89c) + 0xc))();
}
pBVar6 = BitSet128::operator_and(&glowMask,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagGlow);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0x66e65e);
EntityList::QueryRadius
(entityList,GHIDRA_CAST<EntityList_EL *>(local_d08),GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x33c)),
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x370)) * (float)local_890 + 100.0,0xffffffff);
ehState = 5;
local_888 = (EntityPtr)0x0;
iVar7 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_d08))))->EntityList::Size();
if (iVar7 != 0) {
do {
pEVar19 = GHIDRA_CAST<EntityPtr *>(std)::vector<int>::operator_index();
local_898 = *pEVar19;
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_898))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
if ((bVar4 != 0) &&
((*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(EVar14) + 0x3c8)) == GHIDRA_CAST<Entity *>(0x0) ||
(bVar4 = (GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(EVar14) + 0x3c8)))))->Entity::IsDescendantOf(GHIDRA_CAST<Entity *>(local_898)),
bVar4 == 0)))) {
FUN_00417340();
fVar27 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x370));
local_89c = (EntityPtr)fVar27;
FUN_00417340();
fVar27 = fVar27 + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x370)) * 4.0;
local_89c = (EntityPtr)((float)local_89c * (float)local_89c);
local_8ac = (EntityPtr)(fVar27 * fVar27);
pVVar9 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_898))))->Entity::Position(&entityPos15);
local_87c = (EntityPtr)(GHIDRA_CAST<Vector *>((pVVar9)))->Vector::DistanceSquared(GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x33c)));
auVar31 = ZEXT416(GHIDRA_UINT(local_8ac));
if (((float)local_87c < (float)local_8ac) && ((float)local_89c < (float)local_87c)) {
pcVar1 = *(code **)(GHIDRA_INT(*GHIDRA_CAST<float *>(local_898)) + 0x20);
(GHIDRA_CAST<EntityRef *>((&local_2570)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(EVar14));
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0x0);
(*pcVar1)();
}
}
local_888 = (EntityPtr)(GHIDRA_INT(local_888) + 1);
EVar28 = (EntityPtr)(GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_d08))))->EntityList::Size();
} while (GHIDRA_UINT(local_888) < GHIDRA_UINT(EVar28));
}
ehState = 0xffffffff;
(GHIDRA_CAST<EntityList_Query *>((local_d08)))->EntityList_Query::~EntityList_Query();
}
pBVar8 = GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428));
pBVar6 = BitSet128::operator_and(&decelerateMask,pBVar8,&g_tearFlagDecelerate);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
pBVar35 = &g_tearFlagPop;
pBVar6 = BitSet128::operator_or(&withLudovico,&g_tearFlagAbsorb,&g_tearFlagLudovico);
pBVar6 = BitSet128::operator_or(&orResult8,pBVar6,pBVar35);
pBVar6 = BitSet128::operator_and(&andResult18,pBVar8,pBVar6);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsZero();
if (bVar4 != 0) {
fVar27 = assert_lerp_range(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x3a4)),zeroConst,10.0,oneConst,0.8,1);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) = (EntityPtr)(fVar27 * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x36c)));
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x4))) = extraout_var_25;
*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(EVar14) + 0x36c)) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0)));
}
}
pBVar6 = BitSet128::operator_and(&accelerateMask,pBVar8,&g_tearFlagAccelerate);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
pBVar35 = &g_tearFlagPop;
pBVar6 = BitSet128::operator_or(&withLudovico2,&g_tearFlagAbsorb,&g_tearFlagLudovico);
pBVar6 = BitSet128::operator_or(&orResult9,pBVar6,pBVar35);
pBVar6 = BitSet128::operator_and(&andResult19,pBVar8,pBVar6);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsZero();
if (bVar4 != 0) {
local_87c = (EntityPtr)
assert_lerp_range(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x3a4)),zeroConst,10.0,0.8,1.2,1);
local_b2c = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x360)))))->Vector::Length();
local_b2c = local_b2c * (float)local_87c;
local_b28 = 0x41f00000;
pfVar16 = GHIDRA_CAST<float *>(std)::min<float>();
auVar31 = ZEXT416(GHIDRA_UINT(*pfVar16));
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x360)))))->Vector::Resize(*pfVar16);
}
}
pBVar6 = GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428));
pBVar8 = BitSet128::operator_and(&absorbMask,pBVar6,&g_tearFlagAbsorb);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar8)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
pBVar8 = BitSet128::operator_and(&ludovicoMask14,pBVar6,&g_tearFlagLudovico);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar8)))->BitSet128::IsZero();
if (bVar4 != 0) {
local_89c = (EntityPtr)GetRootPlayer(GHIDRA_CAST<Entity_Tear *>(EVar14));
if (local_89c == (EntityPtr)0x0) {
local_8d8 = (EntityPtr)0x40600000;
local_888 = (EntityPtr)0x41200000;
local_aac = oneConst;
}
else {
FUN_005cd770();
local_8b0 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0)));
FUN_0060d040();
local_8d8 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0)));
FUN_005cd750();
local_888 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0)));
FUN_00436190();
local_aac = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0)));
}
EVar29 = (EntityPtr)((float)local_888 / 10.0);
local_b34 = 0x40400000;
pow_wrapper();
EVar28 = local_8d8;
local_87c = EVar29;
FUN_00431260();
local_bb8 = (float)local_87c * (float)EVar28;
local_b30 = 0x41200000;
std::min<float>();
pfVar16 = GHIDRA_CAST<float *>(std)::max<float>();
local_940 = *pfVar16;
auVar31 = ZEXT416(GHIDRA_UINT(local_8b0));
(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(EVar14))))->Entity_Projectile::SetHeight((float)local_8b0);
(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(EVar14))))->Entity_Projectile::set_falling_accel(0.0);
FUN_00444c70();
pBVar8 = BitSet128::operator_or(&withOrbitAdvanced2,&g_tearFlagOrbit,&g_tearFlagOrbitAdvanced)
;
pBVar8 = BitSet128::operator_and(&andResult20,pBVar6,pBVar8);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar8)))->BitSet128::IsZero();
if (bVar4 != 0) {
fVar27 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x36c)) * 0.95;
auVar31 = ZEXT416(GHIDRA_UINT(fVar27));
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x36c)) = fVar27;
}
iVar7 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::FrameCount();
if (10 < iVar7) {
if (local_940 <= *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x420))) {
LAB_0066ebda:
pBVar6 = GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) =
(EntityPtr)Math::clamp(zeroConst,8.0,*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x420)) * 5.0);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x4))) = extraout_var_26;
local_890 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((EntityPtr)GHIDRA_INT((float)auVar31))) + 0x0)));
pBVar8 = BitSet128::operator_and(&splitMask,pBVar6,&g_tearFlagSplit);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar8)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
local_890 = (EntityPtr)(GHIDRA_INT(local_890) + 4);
}
pBVar8 = BitSet128::operator_and(&quadsplitMask2,pBVar6,&g_tearFlagQuadsplit);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar8)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
auVar31 = ZEXT416(GHIDRA_UINT(((float)GHIDRA_INT(local_890) * 1.5)));
local_890 = (EntityPtr)GHIDRA_INT(((float)GHIDRA_INT(local_890) * 1.5));
}
if (GHIDRA_INT(local_890) < 3) {
(GHIDRA_CAST<BitSet128 *>((&g_tearFlagAbsorb)))->BitSet128::__bnot(&notAbsorb2);
FUN_005cd430();
FUN_00444c70();
goto LAB_0066ef8a;
}
fVar27 = random_float();
local_8ac = (EntityPtr)(fVar27 * 360.0);
local_8e0 = GHIDRA_CAST<Entity_Player *>((GHIDRA_INT(EVar14) + 0x410));
local_8b0 = (EntityPtr)0x0;
local_87c = (EntityPtr)(360.0 / (float)GHIDRA_INT(local_890));
while( true ) {
pBVar36 = &g_tearFlagFetus;
uVar37 = 0x50;
uVar38 = 0x4c;
uVar39 = 0xc3;
pBVar35 = &g_tearFlagAbsorb;
pBVar8 = BitSet128::operator_or(&withQuadsplit2,&g_tearFlagSplit,&g_tearFlagQuadsplit);
pBVar8 = BitSet128::operator_or(&orResult10,pBVar8,pBVar35);
pBVar8 = BitSet128::operator_or
(&orResult11,pBVar8,
GHIDRA_CAST<BitSet128 *>(CONCAT22(uVar39,CONCAT11(uVar38,uVar37))));
pBVar8 = BitSet128::operator_or(&orResult12,pBVar8,pBVar36);
pBVar8 = (GHIDRA_CAST<BitSet128 *>((pBVar8)))->BitSet128::__bnot(&notResult9);
BitSet128::operator_and(&inheritedFlags,pBVar6,pBVar8);
uVar18 = Random();
pEVar11 = *GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(EVar14) + 0x3c8));
pVVar9 = Vector::FromAngle(&angleDir6,
(float)GHIDRA_INT(local_8b0) * (float)local_87c + (float)local_8ac);
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__mul(&local_1208,&local_aac);
local_ab0 = 10.0;
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__mul(&local_1210,&local_ab0);
uVar10 = tear->_variant;
if (uVar10 == 0x24) {
uVar10 = 1;
}
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(2,uVar10,tearPos,pVVar9,pEVar11,0,uVar18);
EVar28 = (EntityPtr)__RTDynamicCast();
local_ab4 = 0xc0c00000;
local_898 = EVar28;
pfVar16 = GHIDRA_CAST<float *>(std)::min<float>();
(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(EVar28))))->Entity_Projectile::SetHeight(*pfVar16);
EVar14 = (EntityPtr)tear;
SetScale(GHIDRA_CAST<Entity_Tear *>(EVar28),tear->_baseScale * halfConst);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags_01._l)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(inheritedFlags._l)) + 0x4)));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags_01._l)) + 0x0))) = (undefined4)inheritedFlags._l;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(flags_01._h)) + 0x0))) = (char)(undefined4)inheritedFlags._h;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(flags_01._h)) + 0x1))) = (char)(GHIDRA_UINT((undefined4)inheritedFlags._h) >> 8);
(*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(&(flags_01._h)) + 0x2))) = (short)(GHIDRA_UINT((undefined4)inheritedFlags._h) >> 0x10);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags_01._h)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(inheritedFlags._h)) + 0x4)));
SetTearFlags(GHIDRA_CAST<Entity_Tear *>(EVar28),flags_01);
auVar31 = ZEXT416(GHIDRA_UINT(((GHIDRA_CAST<Entity_Tear *>(EVar14))->_collisionDamage * halfConst)));
(**(code **)(*GHIDRA_CAST<int *>(EVar28) + 0x40))();
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(EVar28) + 0x3c);
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::GetColor();
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0xff);
(*pcVar1)();
FUN_0060cd70();
FUN_0060cd90();
pVVar9 = &(GHIDRA_CAST<Entity_Tear *>(EVar14))->_pos;
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_898))))->Entity::SetTargetPosition(*pVVar9);
pBVar6 = BitSet128::operator_and
(&hydrobounceMask5,&(GHIDRA_CAST<Entity_Tear *>(EVar14))->_tearFlags,
&g_tearFlagHydrobounce);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
FallingSpeed(GHIDRA_CAST<Entity_Tear *>(local_898));
FUN_00444c70();
(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(local_898))))->Entity_Projectile::set_falling_accel(3.0);
}
local_8b0 = (EntityPtr)(GHIDRA_INT(local_8b0) + 1);
if (GHIDRA_INT(local_890) <= GHIDRA_INT(local_8b0)) break;
pBVar6 = &(GHIDRA_CAST<Entity_Tear *>(EVar14))->_tearFlags;
}
(**(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x28))();
}
else {
auVar31 = ZEXT416(GHIDRA_UINT(((float)local_888 * 5.0)));
local_aa4 = 0x96;
local_aa0 = GHIDRA_INT(((float)local_888 * 5.0));
std::min<int>();
local_aa8 = 0x50;
piVar12 = GHIDRA_CAST<int *>(std)::max<int>();
iVar7 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::FrameCount();
if ((*piVar12 <= iVar7) || (cVar5 = Entity::CollidesWithGrid(), cVar5 != '\0'))
goto LAB_0066ebda;
LAB_0066ef8a:
pVVar9 = GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x33c));
}
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(EVar14) + 0x173)) == '\0') {
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0x66efd8);
EntityList::QueryRadius
(entityList,GHIDRA_CAST<EntityList_EL *>(radiusQuery),pVVar9,
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x420)) * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x370)) * 4.0,4);
ehState = 6;
local_8b0 = (EntityPtr)0x0;
iVar7 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(radiusQuery))))->EntityList::Size();
if (iVar7 != 0) {
do {
puVar13 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
local_890 = (EntityPtr)(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar13))))->Entity::ToTear();
if (((local_890 != (EntityPtr)0x0) && (local_890 != EVar14)) &&
(cVar5 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_890))))->Entity::IsDead(), cVar5 == '\0')) {
pBVar8 = &g_tearFlagLudovico;
pBVar6 = TearFlags(GHIDRA_CAST<Entity_Tear *>(local_890),&tearFlagsCopy4);
pBVar6 = BitSet128::operator_and(&andResult21,pBVar6,pBVar8);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 == 0) {
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
cVar5 = DeathmatchManager::is_active();
if ((cVar5 == '\0') ||
(bVar4 = Entity::IsDescendantOf
(GHIDRA_CAST<Entity *>(local_890),*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(EVar14) + 0x3c8))),
bVar4 != 0)) {
FUN_00417340();
local_ab8 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x370));
local_abc = 0x40a00000;
pEVar19 = GHIDRA_CAST<EntityPtr *>(std)::max<float>();
local_87c = *pEVar19;
pVVar15 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_890))))->Entity::Position(&entityPos16);
local_8ac = (EntityPtr)(GHIDRA_CAST<Vector *>((pVVar15)))->Vector::DistanceSquared(pVVar9);
EVar28 = local_890;
auVar31 = ZEXT416(GHIDRA_UINT(((float)local_87c * (float)local_87c)));
if ((float)local_8ac <= (float)local_87c * (float)local_87c) {
fVar26 = (float10)Scale(GHIDRA_CAST<Entity_Tear *>(local_890));
local_87c = (EntityPtr)(float)fVar26;
if (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x420)) <= (float)local_87c) {
pBVar8 = &g_tearFlagAbsorb;
pBVar6 = TearFlags(GHIDRA_CAST<Entity_Tear *>(EVar28),&tearFlagsCopy5);
pBVar6 = BitSet128::operator_and(&andResult22,pBVar6,pBVar8);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsZero();
if (bVar4 == 0) {
local_ad8 = 0x3e4ccccd;
local_ad4 = ((float)local_888 * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar28) + 0x424))) / 50.0;
std::max<float>();
local_adc = 0x3f800000;
pfVar16 = GHIDRA_CAST<float *>(std)::min<float>();
local_ae0 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar28) + 0x424)) + *pfVar16;
pfVar16 = GHIDRA_CAST<float *>(std)::min<float>();
SetScale(GHIDRA_CAST<Entity_Tear *>(EVar28),*pfVar16);
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(EVar28) + 0x40);
fVar26 = (float10)(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_890))))->Entity::CollisionDamage();
local_ae4 = (float)fVar26;
pfVar16 = GHIDRA_CAST<float *>(std)::max<float>();
auVar31 = ZEXT416(GHIDRA_UINT(((float)local_8d8 + *pfVar16)));
(*pcVar1)();
(**(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x28))();
break;
}
}
local_ac4 = 0x3e4ccccd;
local_ac0 = ((float)local_888 * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x424))) / 50.0;
std::max<float>();
local_ac8 = 0x3f800000;
pfVar16 = GHIDRA_CAST<float *>(std)::min<float>();
local_acc = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x424)) + *pfVar16;
pfVar16 = GHIDRA_CAST<float *>(std)::min<float>();
SetScale(GHIDRA_CAST<Entity_Tear *>(EVar14),*pfVar16);
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x40);
fVar26 = (float10)(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_890))))->Entity::CollisionDamage();
local_ad0 = (float)fVar26;
pfVar16 = GHIDRA_CAST<float *>(std)::max<float>();
auVar31 = ZEXT416(GHIDRA_UINT(((float)local_8d8 + *pfVar16)));
(*pcVar1)();
(**(code **)(*GHIDRA_CAST<int *>(local_890) + 0x28))();
pVVar9 = GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x33c));
}
}
}
}
local_8b0 = (EntityPtr)(GHIDRA_INT(local_8b0) + 1);
EVar28 = (EntityPtr)(GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(radiusQuery))))->EntityList::Size();
} while (GHIDRA_UINT(local_8b0) < GHIDRA_UINT(EVar28));
}
ehState = 0xffffffff;
(GHIDRA_CAST<EntityList_Query *>((radiusQuery)))->EntityList_Query::~EntityList_Query();
}
pBVar6 = GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428));
}
}
}
pBVar8 = BitSet128::operator_and(&chainMask,pBVar6,&g_tearFlagChain);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar8)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
iVar7 = EntityPtr::Ref();
if (iVar7 == 0) {
if (8.0 < *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x3a4)) || *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x3a4)) == 8.0) {
(GHIDRA_CAST<BitSet128 *>((&g_tearFlagChain)))->BitSet128::__bnot(&notChain);
FUN_005cd430();
}
else {
if (*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(EVar14) + 0x3bc)) != GHIDRA_CAST<Entity *>(0x0)) {
pVVar9 = (GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(EVar14) + 0x3bc)))))->Entity::Position(&parentPos4);
local_87c = (EntityPtr)(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x33c)))))->Vector::Distance(pVVar9);
if (10.0 < (float)local_87c) {
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>((GHIDRA_INT(EVar14) + 0x494)))))->EntityPtr::Set(*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(EVar14) + 0x3bc)));
goto LAB_0066f416;
}
}
iVar7 = find_nearest_linkable_tear(GHIDRA_CAST<Entity_Tear *>(EVar14));
if (iVar7 != 0) {
FUN_0067ae30();
}
}
}
LAB_0066f416:
auVar31 = ZEXT416(GHIDRA_UINT(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x3a4))));
if ((float)local_8fc < *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x3a4))) {
iVar7 = EntityPtr::Ref();
if (iVar7 != 0) {
pEVar11 = GHIDRA_CAST<Entity *>(EntityPtr)::Ref();
bVar4 = (GHIDRA_CAST<Entity *>((pEVar11)))->Entity::IsTear();
if (bVar4 != 0) goto LAB_0066f4a9;
}
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::IsFrame(4,*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x20)));
if (((bVar4 != 0) && (iVar7 = FUN_0067adc0(), iVar7 < 5)) &&
((iVar7 = Isaac::Random(10), iVar7 == 0 &&
(local_87c = (EntityPtr)find_link_partner(GHIDRA_CAST<Entity_Tear *>(EVar14)),
local_87c != (EntityPtr)0x0)))) {
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>((GHIDRA_INT(EVar14) + 0x494)))))->EntityPtr::Set(GHIDRA_CAST<Entity *>(local_87c));
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>((GHIDRA_INT(local_87c) + 0x498)))))->EntityPtr::Set(GHIDRA_CAST<Entity *>(EVar14));
}
}
LAB_0066f4a9:
apply_link_spring_forces(GHIDRA_CAST<Entity_Tear *>(EVar14));
}
pBVar8 = BitSet128::operator_and(&tractorBeamMask2,pBVar6,&g_tearFlagTractorBeam);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar8)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
pBVar8 = BitSet128::operator_and(&ludovicoMask15,pBVar6,&g_tearFlagLudovico);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar8)))->BitSet128::IsZero();
if ((((bVar4 != 0) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x3bc)) != 0)) &&
(iVar7 = (GHIDRA_CAST<Entity *>(()))->Entity::Type(), iVar7 == 1)) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x478)) == 0)) {
local_8e0 = GHIDRA_CAST<Entity_Player *>(__RTDynamicCast());
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0x0);
(GHIDRA_CAST<Entity_Player *>((local_8e0)))->Entity_Player::GetTractorBeam();
local_8ac = (EntityPtr)__RTDynamicCast();
if (local_8ac != (EntityPtr)0x0) {
pVVar9 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_8e0))))->Entity::Position(&entityPos17);
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x33c)))))->Vector::__sub(&local_cb0,pVVar9);
local_96c = GHIDRA_CAST<undefined1 *>(0x3f800000);
pBVar6 = BitSet128::operator_and(&boomerangMask6,pBVar6,&g_tearFlagBoomerang);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if ((bVar4 != 0) &&
(local_87c = (EntityPtr)(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x360)))))->Vector::Dot(&local_cb0),
(float)local_87c < zeroConst)) {
local_96c = &DAT_bf800000;
}
local_87c = (EntityPtr)(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x360)))))->Vector::Length();
fVar26 = (float10)(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(local_8ac))))->Entity_Projectile::Damage();
Vector::FromAngle(&local_cb8,(float)fVar26);
auVar31 = ZEXT416(GHIDRA_UINT(local_87c));
pVVar9 = (GHIDRA_CAST<Vector *>((&local_cb8)))->Vector::Resized(&resized,(float)local_87c);
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__mul(&local_1238,GHIDRA_CAST<float *>(&local_96c));
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x360)))))->Vector::operator_assign(pVVar9);
pVVar9 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_8e0))))->Entity::Position(&entityPos18);
local_ae8 = (GHIDRA_CAST<Vector *>((&local_cb0)))->Vector::Length();
pVVar15 = (GHIDRA_CAST<Vector *>((&local_cb8)))->Vector::__mul(&local_1248,&local_ae8);
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__add(&local_1250,pVVar15);
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x33c)))))->Vector::operator_assign(pVVar9);
}
}
}
pVVar9 = GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x33c));
outResult = GHIDRA_CAST<TypeDescriptor *>(0x66f6d1);
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::HasEntityFlags(0x80000);
if (bVar4 != 0) {
fVar27 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x3a4));
auVar31 = ZEXT416(GHIDRA_UINT(fVar27));
if (5.0 <= fVar27) {
outResult = GHIDRA_CAST<TypeDescriptor *>(0x66f72f);
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::ClearEntityFlags(0x80000);
}
else {
fVar27 = assert_lerp_range(fVar27,zeroConst,5.0,0.55,1.0,1);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) = (EntityPtr)(fVar27 * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x36c)));
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x4))) = extraout_var_27;
*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(EVar14) + 0x36c)) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0)));
}
}
pBVar6 = BitSet128::operator_and(&popMask,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagPop);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
pBVar6 = BitSet128::operator_and
(&ludovicoMask16,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagLudovico);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsZero();
if (bVar4 != 0) {
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
outResult = GHIDRA_CAST<TypeDescriptor *>(popTearQuery);
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0x66f7b2);
EntityList::QueryRadius
(entityList,GHIDRA_CAST<EntityList_EL *>(outResult),pVVar9,*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x370)) * 4.0,
4);
ehState = 7;
local_8b0 = (EntityPtr)0x0;
iVar7 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(popTearQuery))))->EntityList::Size();
if (iVar7 != 0) {
do {
puVar13 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
local_898 = (EntityPtr)(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar13))))->Entity::ToTear();
if ((local_898 != (EntityPtr)0x0) &&
(uVar10 = (GHIDRA_CAST<PathFinder *>((GHIDRA_CAST<PathFinder *>(local_898))))->PathFinder::GetGridIndex(),
uVar10 <= *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(EVar14) + 0x20)))) {
pVVar15 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_898))))->Entity::Position(&entityPos19);
outResult = GHIDRA_CAST<TypeDescriptor *>(0x66f832);
(GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__sub(&separation,pVVar15);
FUN_00417340();
local_8c0 = (EntityPtr)(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar31)) + 0x0))) + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x370))) * 0.9);
local_87c = (EntityPtr)(GHIDRA_CAST<Vector *>((&separation)))->Vector::LengthSquared();
auVar31 = ZEXT416(GHIDRA_UINT(local_87c));
if ((float)local_87c <= (float)local_8c0 * (float)local_8c0) {
local_87c = (EntityPtr)(GHIDRA_CAST<Vector *>((&separation)))->Vector::LengthSquared();
auVar31 = ZEXT416(GHIDRA_UINT(local_87c));
if ((float)local_87c != zeroConst) {
(GHIDRA_CAST<Vector *>((&separation)))->Vector::Normalized(&separationDir);
pVVar24 = GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x360));
local_8e0 = GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Vector *>((pVVar24)))->Vector)::Dot(&separationDir);
pVVar9 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_898))))->Entity::Velocity(&entityVel3);
local_8d0 = (EntityPtr)(GHIDRA_CAST<Vector *>((pVVar9)))->Vector::Dot(&separationDir);
relSpeed = (float)local_8d0 - (float)local_8e0;
bounceFactor = 1.1;
pVVar9 = (GHIDRA_CAST<Vector *>((&separationDir)))->Vector::__mul(&local_1268,&relSpeed);
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__mul(&local_1270,&bounceFactor);
(GHIDRA_CAST<Vector *>((pVVar24)))->Vector::__add(&bouncedVel,pVVar9);
pVVar9 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_898))))->Entity::Velocity(&entityVel4);
otherRelSpeed = (float)local_8e0 - (float)local_8d0;
auVar31 = ZEXT416(GHIDRA_UINT(otherRelSpeed));
pVVar15 = (GHIDRA_CAST<Vector *>((&separationDir)))->Vector::__mul(&local_1280,&otherRelSpeed);
pVVar15 = (GHIDRA_CAST<Vector *>((pVVar15)))->Vector::__mul(&local_1288,&bounceFactor);
(GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__add(&otherBouncedVel,pVVar15);
fVar27 = (GHIDRA_CAST<Vector *>((&separation)))->Vector::Length();
halfOverlap = ((float)local_8c0 - fVar27) * 0.5;
pVVar9 = (GHIDRA_CAST<Vector *>((&separationDir)))->Vector::__mul(&local_1290,&halfOverlap);
(GHIDRA_CAST<Vector *>((tearPos)))->Vector::__add(&pushedPos,pVVar9);
pVVar9 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_898))))->Entity::Position(&entityPos20);
pVVar15 = (GHIDRA_CAST<Vector *>((&separationDir)))->Vector::__mul(&local_12a0,&halfOverlap);
(GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__sub(&otherPushedPos,pVVar15);
(GHIDRA_CAST<Vector *>((pVVar24)))->Vector::operator_assign(&bouncedVel);
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_898))))->Entity::SetVelocity(&otherBouncedVel);
pVVar9 = tearPos;
(GHIDRA_CAST<Vector *>((tearPos)))->Vector::operator_assign(&pushedPos);
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_898))))->Entity::SetPosition(&otherPushedPos);
EVar14 = (EntityPtr)tear;
tear->_popBounceCount = tear->_popBounceCount + 1;
*GHIDRA_CAST<short *>(&(GHIDRA_CAST<AnimationState *>((GHIDRA_INT(local_898) + 0x46c)))->_animation) =
*GHIDRA_CAST<short *>(&(GHIDRA_CAST<AnimationState *>((GHIDRA_INT(local_898) + 0x46c)))->_animation) + 1;
outResult = GHIDRA_CAST<TypeDescriptor *>(0x2);
in_stack_ffffd9fc = pVVar9;
SoundEffects::PlayWithFartOverride2(0x1ca,GHIDRA_INT(pVVar9),2,0,1.0,oneConst);
}
}
}
local_8b0 = (EntityPtr)(GHIDRA_INT(local_8b0) + 1);
EVar28 = (EntityPtr)(GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(popTearQuery))))->EntityList::Size();
} while (GHIDRA_UINT(local_8b0) < GHIDRA_UINT(EVar28));
}
ehState = 0xffffffff;
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x36c)) = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x36c)) * 0.96;
(GHIDRA_CAST<EntityList_Query *>((popTearQuery)))->EntityList_Query::~EntityList_Query();
}
}
if (-5.0 < *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x410))) {
LAB_0066fb70:
pBVar6 = BitSet128::operator_and
(&ludovicoMask17,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagLudovico);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsZero();
if (bVar4 == 0) goto LAB_0066fc9b;
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x2c)) == 9) && (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(EVar14) + 0x173)) == '\0')) {
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x360)))))->Vector::operator_assign(&g_vectorZero);
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(EVar14) + 0x184)) = 0;
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(EVar14) + 0x188)) = 0;
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(EVar14) + 0x48)))))->Sprite::SetRotation(180.0);
outResult = GHIDRA_CAST<TypeDescriptor *>(0x66fbea);
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(EVar14) + 0x48)))))->ANM2::Play(GHIDRA_CAST<byte *>("Stuck"),0);
}
pBVar6 = BitSet128::operator_and
(&hydrobounceMask6,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagHydrobounce)
;
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x414)) = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x414)) * -1.6;
(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(EVar14))))->Entity_Projectile::SetHeight(-5.0);
}
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(EVar14) + 0x173)) = 1;
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(EVar14) + 0x474)) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(EVar14) + 0x474)) | 4;
apply_death_flag_effects(GHIDRA_CAST<Entity_Tear *>(EVar14),GHIDRA_CAST<Entity *>(0x0));
if ((*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(EVar14) + 0x3bc)) != GHIDRA_CAST<Entity *>(0x0)) &&
(*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(EVar14) + 0x7e8)) != '\0')) {
pEVar17 = (GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(EVar14) + 0x3bc)))))->Entity::ToPlayer();
if (pEVar17 != GHIDRA_CAST<Entity_Player *>(0x0)) {
outResult = GHIDRA_CAST<TypeDescriptor *>(0x66fc84);
bVar4 = (GHIDRA_CAST<Entity_Player *>((pEVar17)))->Entity_Player::HasCollectible(0x175,0);
if (bVar4 != 0) {
(GHIDRA_CAST<Entity_Player *>((pEVar17)))->Entity_Player::ClearDeadEyeCharge();
}
FUN_007cb4f0();
}
}
goto LAB_00670391;
}
pBVar6 = BitSet128::operator_and
(&hydrobounceMask7,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagHydrobounce);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if ((bVar4 != 0) && (-5.0 < *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x414)) + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x410))))
goto LAB_0066fb70;
LAB_0066fc9b:
pBVar6 = BitSet128::operator_or(&withBounceWallsonly,&g_tearFlagBounce,&g_tearFlagBounceWallsonly)
;
outResult = GHIDRA_CAST<TypeDescriptor *>(0x66fcc2);
pBVar6 = BitSet128::operator_and(&andResult23,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),pBVar6);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if ((bVar4 == 0) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x2c)) != 0x2e)) {
LAB_0066fcf0:
pBVar6 = BitSet128::operator_and
(&ludovicoMask18,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagLudovico);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if ((bVar4 != 0) && ((*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(EVar14) + 0x30)) & 2) != 0)) goto LAB_00670254;
pBVar6 = BitSet128::operator_and
(&rerollRockWispMask,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),
&g_tearFlagRerollRockWisp);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
pEVar30 = GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Room *>((room)))->Room)::GetGridIndex(pVVar9);
local_8ac = (EntityPtr)pEVar30;
if (-1 < GHIDRA_INT(pEVar30)) {
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
local_8e0 = GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Room *>((room)))->Room)::GetGridEntity(GHIDRA_UINT(pEVar30));
if ((local_8e0 != GHIDRA_CAST<Entity_Player *>(0x0)) &&
(bVar4 = (GHIDRA_CAST<GridEntity *>((GHIDRA_CAST<GridEntity *>(local_8e0))))->GridEntity::IsBreakableRock(), bVar4 != 0)) {
(GHIDRA_CAST<BitSet128 *>((&g_tearFlagRerollRockWisp)))->BitSet128::__bnot(&notRerollRockWisp);
FUN_005cd430();
FUN_00665b70();
(GHIDRA_CAST<GridEntity_Rock *>((GHIDRA_CAST<GridEntity_Rock *>(local_8e0))))->GridEntity_Rock::UpdateNeighbors();
local_87c = (EntityPtr)(GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>((GHIDRA_INT(EVar14) + 0x3dc)))))->RNG::RandomInt(6);
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
tintedRockIdx = (GHIDRA_CAST<Room *>((room)))->Room::GetTintedRockIdx();
local_890 = (EntityPtr)(GHIDRA_UINT((pEVar30 == GHIDRA_CAST<Entity_Projectile *>(tintedRockIdx))) * 2 + 2);
if ((pEVar30 == GHIDRA_CAST<Entity_Projectile *>(tintedRockIdx)) &&
(uVar10 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>((GHIDRA_INT(EVar14) + 0x3dc)))))->RNG::RandomInt(0x14), uVar10 == 0)) {
persistentGameData = GHIDRA_CAST<PersistentGameData *>((GHIDRA_CAST<Room *>((GHIDRA_CAST<Room *>(g_manager))))->Room)::GetTopLeftPos();
bVar4 = (GHIDRA_CAST<PersistentGameData *>((persistentGameData)))->PersistentGameData::Unlocked(0x143);
if (bVar4 != 0) {
local_890 = (EntityPtr)0x16;
}
}
local_888 = (EntityPtr)0x0;
switch(local_87c) {
case (EntityPtr)0x0:
local_87c = (EntityPtr)(GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>((GHIDRA_INT(EVar14) + 0x3dc)))))->RNG::RandomFloat();
local_890 = (EntityPtr)0xe;
if (pointSixConst <= (float)local_87c) {
if (0.8 <= (float)local_87c) {
if (0.95 <= (float)local_87c) {
if (0.97 <= (float)local_87c) {
local_888 = (EntityPtr)(((float)local_87c < 0.98) + 3);
}
else {
local_888 = (EntityPtr)0x5;
}
}
else {
local_888 = (EntityPtr)0x1;
}
}
else {
local_888 = (EntityPtr)0x2;
}
}
break;
case (EntityPtr)0x1:
local_890 = (EntityPtr)0x5;
break;
case (EntityPtr)0x2:
local_890 = (EntityPtr)0x6;
break;
case (EntityPtr)0x3:
local_890 = (EntityPtr)0x3;
break;
case (EntityPtr)0x4:
local_890 = (EntityPtr)0xc;
}
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
(GHIDRA_CAST<Room *>((room)))->Room::SetGridPath(GHIDRA_INT(pEVar30),0);
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
uVar10 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>((GHIDRA_INT(EVar14) + 0x3dc)))))->RNG::Next();
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(local_890);
outResult = GHIDRA_CAST<TypeDescriptor *>(local_888);
(GHIDRA_CAST<Room *>((room)))->Room::SpawnGridEntity(GHIDRA_INT(local_8ac),GHIDRA_UINT(local_890),GHIDRA_UINT(local_888),uVar10,0);
}
}
goto LAB_00670391;
}
if ((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(EVar14) + 400)) != '\0') && (-60.0 < *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x410)))) {
pBVar6 = BitSet128::operator_and
(&ludovicoMask19,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagLudovico);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsZero();
if ((bVar4 == 0) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x2c)) == 9)) goto LAB_0066ffc8;
LAB_00670079:
pBVar6 = BitSet128::operator_and
(&spectralMask2,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagSpectral);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsZero();
if ((bVar4 == 0) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x2c)) != 4)) goto LAB_00670391;
pBVar6 = BitSet128::operator_and
(&stickyMask2,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagSticky);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsZero();
if (bVar4 == 0) {
LAB_00670113:
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x478)) != 0) goto LAB_00670391;
}
else {
pBVar6 = BitSet128::operator_and
(&boogerMask,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagBooger);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsZero();
if (bVar4 == 0) goto LAB_00670113;
pBVar6 = BitSet128::operator_and
(&sporeMask2,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagSpore);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsZero();
if (bVar4 == 0) goto LAB_00670113;
}
game = g_game;
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(EVar14) + 0x173)) = 1;
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(EVar14) + 0x474)) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(EVar14) + 0x474)) | 1;
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(game))))->Level)::GetCurrentRoom();
local_880 = pVVar9->x;
local_87c = (EntityPtr)pVVar9->y;
outResult = GHIDRA_CAST<TypeDescriptor *>(0x670165);
iVar7 = (GHIDRA_CAST<Room *>((room)))->Room::GetGridCollisionAtPos(*pVVar9);
if (iVar7 == 4) {
LAB_006701a6:
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(EVar14) + 0x474)) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(EVar14) + 0x474)) | 2;
}
else {
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
local_880 = pVVar9->x;
local_87c = (EntityPtr)pVVar9->y;
outResult = GHIDRA_CAST<TypeDescriptor *>(0x6701a1);
iVar7 = (GHIDRA_CAST<Room *>((room)))->Room::GetGridCollisionAtPos(*pVVar9);
if (iVar7 == 5) goto LAB_006701a6;
}
apply_death_flag_effects(GHIDRA_CAST<Entity_Tear *>(EVar14),GHIDRA_CAST<Entity *>(0x0));
try_make_bridges();
if (((*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(EVar14) + 0x3bc)) != GHIDRA_CAST<Entity *>(0x0)) &&
(*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(EVar14) + 0x7e8)) != '\0')) &&
(local_87c = (EntityPtr)(GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(EVar14) + 0x3bc)))))->Entity::ToPlayer(),
local_87c != (EntityPtr)0x0)) {
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
gridEntity = (GHIDRA_CAST<Room *>((room)))->Room::GetGridEntityFromPos(pVVar9);
if ((gridEntity == GHIDRA_CAST<GridEntity *>(0x0)) ||
((iVar7 = (GHIDRA_CAST<GridEntity *>((gridEntity)))->GridEntity::GetType(), iVar7 != 0xe &&
(iVar7 = (GHIDRA_CAST<GridEntity *>((gridEntity)))->GridEntity::GetType(), iVar7 != 0xc)))) {
EVar28 = local_87c;
FUN_007cb4f0();
outResult = GHIDRA_CAST<TypeDescriptor *>(0x670240);
bVar4 = (GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(EVar28))))->Entity_Player::HasCollectible(0x175,0);
if (bVar4 != 0) {
(GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(EVar28))))->Entity_Player::ClearDeadEyeCharge();
}
}
}
goto LAB_00670391;
}
LAB_0066ffc8:
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
local_880 = pVVar9->x;
local_87c = (EntityPtr)pVVar9->y;
outResult = GHIDRA_CAST<TypeDescriptor *>(0x66ffff);
iVar7 = (GHIDRA_CAST<Room *>((room)))->Room::GetGridCollisionAtPos(*pVVar9);
if (iVar7 != 4) {
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
local_880 = pVVar9->x;
local_87c = (EntityPtr)pVVar9->y;
outResult = GHIDRA_CAST<TypeDescriptor *>(0x67003b);
iVar7 = (GHIDRA_CAST<Room *>((room)))->Room::GetGridCollisionAtPos(*pVVar9);
if (iVar7 == 5) {
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
iVar7 = (GHIDRA_CAST<Room *>((room)))->Room::GetGridPathFromPos(pVVar9);
if (iVar7 < 3000) goto LAB_00670062;
}
goto LAB_00670391;
}
LAB_00670062:
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(EVar14) + 400)) == '\0') goto LAB_00670391;
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x2c)) != 9) goto LAB_00670079;
LAB_0067039b:
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(EVar14) + 0x173)) == '\0') {
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
EVar28 = (EntityPtr)(GHIDRA_INT(EVar14) + 0x33c);
outResult = GHIDRA_CAST<TypeDescriptor *>(&DAT_bf800000);
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(EVar28);
Room::GetClampedPositionImpl
(room,&roomClampedPos,GHIDRA_CAST<Vector *>(EVar28),-1.0,-20.0,-40.0,(float)local_8cc);
bVar4 = (GHIDRA_CAST<Vector *>((&roomClampedPos)))->Vector::operator_ne(GHIDRA_CAST<Vector *>(EVar28));
if (bVar4 != 0) {
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
pEVar19 = GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<Room *>((room)))->Room)::GetTopLeftPos();
local_87c = *pEVar19;
local_8cc = pEVar19[1];
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
puVar13 = GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<Room *>((room)))->Room)::GetBottomRightPos();
local_8ac = (EntityPtr)*puVar13;
local_8e0 = GHIDRA_CAST<Entity_Player *>(puVar13[1]);
outResult = GHIDRA_CAST<TypeDescriptor *>(0x670463);
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(EVar14) + 0x48)))))->ANM2::Play(GHIDRA_CAST<byte *>("Stuck"),0);
if ((float)local_87c <= *GHIDRA_CAST<float *>(EVar28)) {
if (*GHIDRA_CAST<float *>(EVar28) <= (float)local_8ac) {
if ((float)local_8cc <= *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x340))) {
if ((float)local_8e0 < *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x340))) {
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(EVar14) + 0x48)))))->Sprite::set_flip_x(zeroConst < *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x360)));
set_byte_0x101((void *)(GHIDRA_INT(EVar14) + 0x48),1);
}
}
else {
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(EVar14) + 0x48)))))->Sprite::set_flip_x(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x360)) <= zeroConst &&
zeroConst != *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x360)));
}
}
else {
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(EVar14) + 0x48)))))->Sprite::SetRotation(90.0);
}
}
else {
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(EVar14) + 0x48)))))->Sprite::SetRotation(90.0);
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(EVar14) + 0x48)))))->Sprite::set_flip_x(1);
}
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x360)))))->Vector::operator_assign(&g_vectorZero);
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(EVar14) + 0x184)) = 0;
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(EVar14) + 0x188)) = 0;
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(EVar14) + 0x173)) = 1;
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(EVar14) + 0x474)) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(EVar14) + 0x474)) | 3;
}
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
local_87c = (EntityPtr)(GHIDRA_CAST<Room *>((room)))->Room::GetGridIndex(GHIDRA_CAST<Vector *>(EVar28));
if (-1 < GHIDRA_INT(local_87c)) {
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
(GHIDRA_CAST<EntityRef *>((&local_2598)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(EVar14));
outResult = GHIDRA_CAST<TypeDescriptor *>(0x0);
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(local_87c);
Room::DestroyGridWithSource(room);
}
}
}
else {
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
bVar4 = (GHIDRA_CAST<Room *>((room)))->Room::IsBeastDungeon();
if (bVar4 != 0) goto LAB_0066fcf0;
LAB_00670254:
pBVar6 = BitSet128::operator_and
(&spectralMask3,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagSpectral);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
uVar20 = 6;
if (bVar4 != 0) {
uVar20 = 3;
}
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(EVar14) + 0x184)) = uVar20;
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(EVar14) + 400)) != '\0') {
pVVar9 = GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x360));
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x33c)))))->Vector::__sub(&local_12a8,pVVar9);
try_make_bridges();
(GHIDRA_CAST<Vector *>((pVVar9)))->Vector::Normalize();
local_af0 = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x194)))))->Vector::Length();
(GHIDRA_CAST<Vector *>((pVVar9)))->Vector::operator_mul_assign(&local_af0);
(GHIDRA_CAST<BitSet128 *>((&g_tearFlagTractorBeam)))->BitSet128::__bnot(&notTractorBeam);
FUN_005cd430();
(GHIDRA_CAST<std::vector *>(((void *)(GHIDRA_INT(EVar14) + 0x444))))->std::vector::clear(0);
local_87c = (EntityPtr)oneConst;
EVar28 = (EntityPtr)oneConst;
if (*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(EVar14) + 0x3c8)) != GHIDRA_CAST<Entity *>(0x0)) {
bVar4 = (GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(EVar14) + 0x3c8)))))->Entity::is_player();
if (bVar4 == 0) {
EVar28 = local_87c;
}
else {
(GHIDRA_CAST<Entity_Player *>((*GHIDRA_CAST<Entity_Player **>((GHIDRA_CAST<char *>(EVar14) + 0x3c8)))))->Entity_Player::IsLocalPlayer();
}
}
outResult = GHIDRA_CAST<TypeDescriptor *>(0x2);
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0x389);
SoundEffects::PlayWithFartOverride(0x389,(float)EVar28,2,0,1.0);
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
bVar4 = (GHIDRA_CAST<Room *>((room)))->Room::is_type_16();
if (bVar4 != 0) {
(GHIDRA_CAST<BitSet128 *>((&g_tearFlagBounce)))->BitSet128::__bnot(&notBounce);
FUN_005cd430();
}
}
LAB_00670391:
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x2c)) == 9) goto LAB_0067039b;
}
pVVar9 = GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x33c));
if (((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x2c)) == 0x2b) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x2c)) == 0x2c)) &&
((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(EVar14) + 0x173)) == '\0' &&
(local_8b0 = (EntityPtr)(GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(EVar14) + 0x3c8)))))->Entity::ToPlayer(),
local_8b0 != (EntityPtr)0x0)))) {
(GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__add(&local_9cc,GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x360)));
bVar4 = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x360)))))->Vector::operator_ne(&g_vectorZero);
if (bVar4 != 0) {
pVVar9 = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x360)))))->Vector::Normalized(&direction12);
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__mul(&local_12b8,GHIDRA_CAST<float *>((GHIDRA_INT(EVar14) + 0x370)));
(GHIDRA_CAST<Vector *>((&local_9cc)))->Vector::operator_add_assign(pVVar9);
}
local_890 = (EntityPtr)(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
uVar10 = (GHIDRA_CAST<Room *>((GHIDRA_CAST<Room *>(local_890))))->Room::GetGridIndex(&local_9cc);
if (-1 < GHIDRA_INT(uVar10)) {
local_88c = (EntityPtr)(GHIDRA_CAST<Room *>((GHIDRA_CAST<Room *>(local_890))))->Room::GetGridEntity(uVar10);
pos.y = local_9cc.y;
pos.x = local_9cc.x;
local_8cc = (EntityPtr)(GHIDRA_CAST<Room *>((GHIDRA_CAST<Room *>(local_890))))->Room::GetGridCollisionAtPos(pos);
local_898 = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(EVar14) + 0x184));
if (local_88c != (EntityPtr)0x0) {
iVar7 = (GHIDRA_CAST<GridEntity *>((GHIDRA_CAST<GridEntity *>(local_88c))))->GridEntity::GetType();
if ((iVar7 == 0x10) && (local_8cc == (EntityPtr)0x4)) {
bVar4 = (GHIDRA_CAST<GridEntity_Door *>((GHIDRA_CAST<GridEntity_Door *>(local_88c))))->GridEntity_Door::IsLocked();
if ((bVar4 == 0) || (cVar5 = FUN_00436000(), cVar5 != '\0')) {
bVar4 = (GHIDRA_CAST<GridEntity_Door *>((GHIDRA_CAST<GridEntity_Door *>(local_88c))))->GridEntity_Door::IsRoomType(7);
if ((bVar4 == 0) &&
(bVar4 = (GHIDRA_CAST<GridEntity_Door *>((GHIDRA_CAST<GridEntity_Door *>(local_88c))))->GridEntity_Door::IsRoomType(8), bVar4 == 0)) {
iVar7 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_88c))))->EntityList::Size();
if (iVar7 == 2) goto LAB_006708cc;
(GHIDRA_CAST<GridEntity_Door *>((GHIDRA_CAST<GridEntity_Door *>(local_88c))))->GridEntity_Door::Open();
}
else {
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(local_88c) + 0x14);
(GHIDRA_CAST<EntityRef *>((&local_25e8)))->EntityRef::EntityRef();
(*pcVar1)();
}
}
else {
(GHIDRA_CAST<GridEntity_Door *>((GHIDRA_CAST<GridEntity_Door *>(local_88c))))->GridEntity_Door::TryUnlock(GHIDRA_CAST<Entity_Player *>(local_8b0),1);
}
LAB_00670792:
if (local_898 == (EntityPtr)0x4) {
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::Die();
}
}
else {
iVar7 = (GHIDRA_CAST<GridEntity *>((GHIDRA_CAST<GridEntity *>(local_88c))))->GridEntity::GetType();
if (iVar7 == 0xb) {
iVar7 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_88c))))->EntityList::Size();
if (iVar7 == 0) {
(GHIDRA_CAST<GridEntity_Lock *>((GHIDRA_CAST<GridEntity_Lock *>(local_88c))))->GridEntity_Lock::try_unlock(GHIDRA_CAST<Entity_Player *>(local_8b0),1)
;
goto LAB_00670792;
}
}
else if ((((local_8cc == (EntityPtr)0x3) || (local_8cc == (EntityPtr)0x2)) &&
(iVar7 = FUN_00499db0(), iVar7 == 3)) &&
((local_898 == (EntityPtr)0x4 || (iVar7 = Isaac::Random(8), iVar7 == 0)))) {
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(local_88c) + 0x14);
(GHIDRA_CAST<EntityRef *>((&local_25c0)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(EVar14));
cVar5 = (*pcVar1)();
if (cVar5 != '\0') {
if (local_898 == (EntityPtr)0x4) {
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::Die();
}
(GHIDRA_CAST<GridEntity *>((GHIDRA_CAST<GridEntity *>(local_88c))))->GridEntity::Position(&gridPos);
pVVar9 = (GHIDRA_CAST<Vector *>((&gridPos)))->Vector::__sub(&local_12c0,GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x33c)));
pVVar9 = Vector::ToCardinal(&cardinalDir,pVVar9);
local_af4 = 40.0;
pVVar9 = Vector::operator_mul(&local_12d0,&local_af4,pVVar9);
pVVar9 = (GHIDRA_CAST<Vector *>((&gridPos)))->Vector::__add(&local_12d8,pVVar9);
uVar10 = (GHIDRA_CAST<Room *>((GHIDRA_CAST<Room *>(local_890))))->Room::GetGridIndex(pVVar9);
if (-1 < GHIDRA_INT(uVar10)) {
EVar28 = local_88c;
gridEntity = (GHIDRA_CAST<Room *>((GHIDRA_CAST<Room *>(local_890))))->Room::GetGridEntity(uVar10);
(GHIDRA_CAST<Room *>((GHIDRA_CAST<Room *>(local_890))))->Room::TryMakeBridge(gridEntity,GHIDRA_CAST<GridEntity *>(EVar28));
}
}
}
}
}
}
LAB_006708cc:
pVVar9 = GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x33c));
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
outResult = GHIDRA_CAST<TypeDescriptor *>((GHIDRA_INT(local_d08) + 0x10));
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0x6708f0);
EntityList::QueryRadius(entityList,GHIDRA_CAST<EntityList_EL *>(outResult),pVVar9,24.0,0x10);
ehState = 8;
iVar7 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>((local_d08 + 0x10)))))->EntityList::Size();
EVar28 = local_8b0;
if (iVar7 != 0) {
uVar10 = 0;
do {
pEVar19 = GHIDRA_CAST<EntityPtr *>(std)::vector<int>::operator_index();
local_890 = *pEVar19;
if (local_890 != (EntityPtr)0x0) {
cVar5 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_890))))->Entity::is_pickup();
if ((cVar5 == '\0') ||
(((iVar7 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_890))))->Entity::Variant(), iVar7 != 0x3c &&
(iVar7 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_890))))->Entity::Variant(), iVar7 != 0x35)) &&
(iVar7 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_890))))->Entity::Variant(), iVar7 != 0x37)))) {
cVar5 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_890))))->Entity::is_slot();
if ((cVar5 != '\0') && (iVar7 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_890))))->Entity::Variant(), iVar7 == 7)) {
Entity::ForceCollide(GHIDRA_CAST<Entity *>(EVar28),GHIDRA_CAST<Entity *>(local_890),1);
}
}
else {
(GHIDRA_CAST<Entity_Pickup *>((GHIDRA_CAST<Entity_Pickup *>(local_890))))->Entity_Pickup::TryOpenChest(GHIDRA_CAST<Entity_Player *>(EVar28));
}
}
uVar10 = uVar10 + 1;
uVar18 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>((local_d08 + 0x10)))))->EntityList::Size();
} while (uVar10 < uVar18);
pVVar9 = &tear->_pos;
EVar14 = (EntityPtr)tear;
}
ehState = 0xffffffff;
(GHIDRA_CAST<EntityList_Query *>((local_d08 + 0x10)))->EntityList_Query::~EntityList_Query();
}
pBVar6 = BitSet128::operator_and
(&ludovicoMask20,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagLudovico);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
local_888 = (EntityPtr)(*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(EVar14) + 0x30)) >> 1 & 0xffffff01);
local_8a1 = is_not_familiar_spawned(GHIDRA_CAST<Entity_Tear *>(EVar14));
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_888)) + 0x0))) == '\0') {
fVar27 = 0.7;
}
else {
fVar27 = 0.98;
}
EVar28 = (EntityPtr)(fVar27 * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x36c)));
*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(EVar14) + 0x36c)) = EVar28;
local_890 = (EntityPtr)GetRootPlayer(GHIDRA_CAST<Entity_Tear *>(EVar14));
if (local_890 == (EntityPtr)0x0) {
EVar28 = (EntityPtr)0x41200000;
}
else {
FUN_005cd750();
}
local_8cc = EVar28;
pBVar6 = BitSet128::operator_and(&flatMask2,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagFlat);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
if (local_890 == (EntityPtr)0x0) {
outResult = GHIDRA_CAST<TypeDescriptor *>(0x670aac);
bVar4 = (GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(0x0))))->Entity_Player::HasTrinket(0xc,0);
if (bVar4 != 0) goto LAB_00670ae2;
}
pVVar15 = (GHIDRA_CAST<Vector *>((&local_12e0)))->Vector::Vector(oneConst,oneConst);
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x374)))))->Vector::operator_assign(pVVar15);
FUN_00665a50();
}
LAB_00670ae2:
if ((*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(EVar14) + 0x3bc)) != GHIDRA_CAST<Entity *>(0x0)) &&
(bVar4 = (GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(EVar14) + 0x3bc)))))->Entity::IsFamiliar(), bVar4 != 0)) {
local_8dc = local_8dc * local_8ec;
}
local_8b0 = (EntityPtr)(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x360)))))->Vector::Length();
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_888)) + 0x0))) != '\0') {
fVar27 = assert_lerp_range((float)local_8b0,10.0,20.0,0.9,2.0,1);
local_8dc = fVar27 * local_8dc;
}
local_89c = (EntityPtr)(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::GetIntervalTicks((float)local_8cc,zeroConst);
if (local_89c != (EntityPtr)0x0) {
(GHIDRA_CAST<std::vector *>(((void *)(GHIDRA_INT(EVar14) + 0x444))))->std::vector::clear(0);
try_make_bridges();
if (local_890 != (EntityPtr)0x0) {
pEVar11 = *GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(EVar14) + 0x3c8));
iVar7 = Isaac::Random(2);
EVar28 = local_890;
Entity_Player::GetTearHitParams
(GHIDRA_CAST<Entity_Player *>(local_890),&local_f8,8,1.0,iVar7 * 2 + -1,pEVar11);
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(EVar14) + 0x484)) = 0;
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x2c)) != local_f8._tearVariant) {
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x2c)) = local_f8._tearVariant;
cVar5 = FUN_00665cc0();
if (cVar5 != '\0') {
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::LoadEntityConfig();
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(EVar14) + 0x184)) = 0;
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x330)) != 0) {
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(EVar14) + 0x48)))))->ANM2::Load(GHIDRA_CAST<std_string *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x330)) + 0x74)),1);
bVar4 = 0;
psVar21 = (std_string *)
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(EVar14) + 0x48)))))->Sprite::GetDefaultAnimationName();
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(EVar14) + 0x48)))))->Sprite::Play(psVar21,bVar4);
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(EVar14) + 0x48)))))->Sprite::SetRotation(0.0);
ResetSpriteScale(GHIDRA_CAST<Entity_Tear *>(EVar14));
}
}
}
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_888)) + 0x0))) != '\0') {
if (10.0 < (float)local_8b0) {
fVar27 = assert_lerp_range((float)local_8b0,10.0,20.0,oneConst,6.0,1);
local_f8._tearDamage = fVar27 * local_f8._tearDamage;
fVar27 = assert_lerp_range((float)local_8b0,10.0,(float)local_8fc,zeroConst,6.0,1);
local_f8._tearDamage = fVar27 + local_f8._tearDamage;
}
(GHIDRA_CAST<BitSet128 *>((&local_f8._flags)))->BitSet128::operator__(&g_tearFlagSpectral);
}
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x3c);
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x388)) = local_f8._tearDamage;
(*pcVar1)();
pBVar8 = &g_tearFlagLudovico;
pBVar6 = (GHIDRA_CAST<BitSet128 *>((&g_tearFlagBounce)))->BitSet128::__bnot(&notBounce2);
pBVar6 = BitSet128::operator_and(&andResult24,&local_f8._flags,pBVar6);
pBVar6 = BitSet128::operator_or(&orResult13,pBVar6,pBVar8);
EVar29 = *GHIDRA_CAST<EntityPtr *>(&pBVar6->_l);
outResult = *GHIDRA_CAST<TypeDescriptor **>((GHIDRA_INT(&pBVar6->_l) + 4));
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(flags_02._h)) + 0x1))) = (char)(pBVar6->_h >> 8);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(flags_02)) + 0x0))) = *GHIDRA_CAST<unkbyte9 *>(pBVar6);
(*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(&(flags_02._h)) + 0x2))) = (short)(pBVar6->_h >> 0x10);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags_02._h)) + 0x4))) = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&pBVar6->_h) + 4));
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(EVar29);
SetTearFlags(GHIDRA_CAST<Entity_Tear *>(EVar14),flags_02);
if (local_8a1 != 0) {
pBVar6 = BitSet128::operator_and
(&growMask2,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagGrow);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
pVVar9 = (GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(EVar14) + 0x3bc)))))->Entity::Position(&parentPos5);
local_87c = (EntityPtr)(GHIDRA_CAST<Vector *>((pVVar9)))->Vector::Distance(GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x33c)));
fVar27 = Math::clamp(oneConst,700.0,(float)local_87c);
EVar29 = (EntityPtr)((fVar27 / 700.0 + oneConst) * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x388)));
*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(EVar14) + 0x388)) = EVar29;
}
pBVar6 = BitSet128::operator_and
(&shrinkMask2,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagShrink);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
pVVar9 = (GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(EVar14) + 0x3bc)))))->Entity::Position(&parentPos6);
local_87c = (EntityPtr)(GHIDRA_CAST<Vector *>((pVVar9)))->Vector::Distance(GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x33c)));
fVar27 = Math::clamp(zeroConst,700.0,(float)local_87c);
EVar29 = (EntityPtr)(fVar27 / 900.0);
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x388)) =
(oneConst - (float)EVar29) * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x388));
}
EVar28 = local_890;
}
pBVar6 = BitSet128::operator_and
(&occultMask2,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagOccult);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (((bVar4 == 0) ||
(iVar7 = (GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(EVar28))))->Entity_Player::GetFireDirection(), iVar7 == -1)) ||
(GHIDRA_INT(local_89c) < 1)) {
pVVar9 = GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x33c));
}
else {
do {
pVVar9 = MusicManager::RandomVector(&randomDir4);
FUN_00436190();
EVar29 = (EntityPtr)((float)EVar29 * 10.0);
local_af8 = EVar29;
pVVar15 = Vector::operator_mul(&local_1300,GHIDRA_CAST<float *>(&local_af8),pVVar9);
pVVar9 = GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x33c));
outResult = GHIDRA_CAST<TypeDescriptor *>(0x7);
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(pVVar15->y);
Entity_Player::FireTear
(GHIDRA_CAST<Entity_Player *>(local_890),pVVar9,*pVVar15,7,GHIDRA_CAST<Entity *>(EVar14),1.0);
local_89c = (EntityPtr)(GHIDRA_INT(local_89c) + -1);
} while (local_89c != (EntityPtr)0x0);
local_89c = (EntityPtr)0x0;
}
}
}
if (local_8a1 == 0) {
if (((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x3bc)) != 0) && (iVar7 = (GHIDRA_CAST<Entity *>(()))->Entity::Type(), iVar7 == 2)) &&
(iVar7 = (GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(EVar14) + 0x3bc)))))->Entity::Variant(),
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x2c)) != iVar7)) {
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x2c)) = iVar7;
cVar5 = FUN_00665cc0();
if (cVar5 != '\0') {
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::LoadEntityConfig();
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x330)) != 0) {
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(EVar14) + 0x48)))))->ANM2::Load(GHIDRA_CAST<std_string *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x330)) + 0x74)),1);
bVar4 = 0;
psVar21 = GHIDRA_CAST<std_string *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(EVar14) + 0x48)))))->Sprite)::GetDefaultAnimationName();
outResult = GHIDRA_CAST<TypeDescriptor *>(0x6715e3);
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(EVar14) + 0x48)))))->Sprite::Play(psVar21,bVar4);
ResetSpriteScale(GHIDRA_CAST<Entity_Tear *>(EVar14));
}
}
}
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x2c));
if (((iVar7 == 5) || (iVar7 == 6)) ||
((iVar7 == 7 || (((iVar7 == 0x14 || (iVar7 == 0x21)) || (iVar7 == 0x22)))))) {
LAB_0067162f:
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(EVar14) + 0x48)))))->Sprite::SetRotation(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x458)));
}
else {
pBVar6 = BitSet128::operator_and
(&flatMask3,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagFlat);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 != 0) goto LAB_0067162f;
}
if ((*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(EVar14) + 0x30)) & 1) != 0) {
if (*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(EVar14) + 0x3bc)) != GHIDRA_CAST<Entity *>(0x0)) {
pVVar9 = (GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(EVar14) + 0x3bc)))))->Entity::Position(&parentPos7);
pVVar24 = GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x7f4));
iVar7 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(tear))))->Entity::FrameCount();
iVar7 = iVar7 + tear->_index * 0x32;
fVar27 = sinf_wrapper((float)((double)iVar7 + __uint_to_double_fixup[-(iVar7 >> 0x1f)]) *
0.08);
local_87c = (EntityPtr)(fVar27 * halfConst + oneConst);
fVar27 = (GHIDRA_CAST<Vector *>((pVVar24)))->Vector::Length();
pVVar15 = (GHIDRA_CAST<Vector *>((pVVar24)))->Vector::Resized(&resized2,fVar27 * (float)local_87c);
pVVar15 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__add(&local_1388,pVVar15);
pVVar9 = tearPos;
(GHIDRA_CAST<Vector *>((tearPos)))->Vector::operator_assign(pVVar15);
outResult = GHIDRA_CAST<TypeDescriptor *>(0x67174f);
pVVar15 = (GHIDRA_CAST<Vector *>((pVVar24)))->Vector::Rotated(&rotatedDir,
((float)(GHIDRA_UINT(tear->_index) % 10) + 0.0) * 0.1 - 4.0);
(GHIDRA_CAST<Vector *>((pVVar24)))->Vector::operator_assign(pVVar15);
EVar14 = (EntityPtr)tear;
}
}
if (*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(EVar14) + 0x3bc)) == (EntityPtr)0x0) {
(**(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x28))();
}
}
else {
FUN_00424510();
ehState = 9;
for (chainChild = GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity)::Child(); chainChild != GHIDRA_CAST<Entity *>(0x0);
chainChild = GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>((chainChild)))->Entity)::Child()) {
std::vector<unsigned_int>::push_back();
}
local_8ec = 0.0;
iVar7 = (GHIDRA_CAST<std::vector *>((local_9e0)))->std::vector::size();
if (iVar7 != 0) {
do {
pEVar19 = GHIDRA_CAST<EntityPtr *>(FUN_0042c810());
local_898 = *pEVar19;
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_898))))->Entity::SetVelocity(GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x360)));
local_8b0 = (EntityPtr)
((float)((double)GHIDRA_INT(local_8ec) +
__uint_to_double_fixup[-(GHIDRA_INT(local_8ec) >> 0x1f)]) * 360.0);
iVar7 = (GHIDRA_CAST<std::vector *>((local_9e0)))->std::vector::size();
local_8b0 = (EntityPtr)
((float)local_8b0 /
(float)((double)iVar7 + __uint_to_double_fixup[-(iVar7 >> 0x1f)]));
iVar7 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::FrameCount();
local_8cc = (EntityPtr)((float)iVar7 * 5.0 + (float)local_8b0);
local_948 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x370)) + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x370));
iVar7 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_898))))->Entity::FrameCount();
if (iVar7 < 0x32) {
iVar7 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_898))))->Entity::FrameCount();
local_948 = ((float)iVar7 / 50.0) * local_948;
}
pVVar15 = Vector::FromAngle(&angleDir7,(float)local_8cc);
pVVar15 = (GHIDRA_CAST<Vector *>((pVVar15)))->Vector::__mul(&local_1310,&local_948);
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__add(&local_1318,pVVar15);
pVVar15 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_898))))->Entity::Position(&entityPos21);
bVar4 = 0;
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__sub(&local_1328,pVVar15);
EVar28 = local_898;
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_898))))->Entity::AddVelocity_divided(pVVar9,bVar4);
fVar26 = (float10)Scale(GHIDRA_CAST<Entity_Tear *>(EVar14));
SetScale(GHIDRA_CAST<Entity_Tear *>(EVar28),(float)(fVar26 * (float10)0.5));
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(EVar28) + 0x3c);
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::GetColor();
outResult = GHIDRA_CAST<TypeDescriptor *>(0xff);
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0xffffffff);
(*pcVar1)();
pBVar6 = (GHIDRA_CAST<BitSet128 *>((&g_tearFlagExplosive)))->BitSet128::__bnot(&notExplosive2);
pBVar6 = BitSet128::operator_and(&andResult25,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),pBVar6);
EVar28 = local_898;
SetTearFlags(GHIDRA_CAST<Entity_Tear *>(local_898),*pBVar6);
FUN_0044bfa0();
(**(code **)(*GHIDRA_CAST<int *>(EVar28) + 0x40))();
normalize_angle_degrees((float)local_8cc + 90.0);
FUN_004aadb0();
fVar23 = (float)(GHIDRA_INT(local_8ec) + 1);
local_8ec = fVar23;
fVar27 = (float)(GHIDRA_CAST<std::vector *>((local_9e0)))->std::vector::size();
pVVar9 = GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x33c));
} while (GHIDRA_UINT(fVar23) < GHIDRA_UINT(fVar27));
}
if (*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(EVar14) + 0x3bc)) != GHIDRA_CAST<Entity *>(0x0)) {
bVar4 = (GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(EVar14) + 0x3bc)))))->Entity::IsFamiliar();
if (bVar4 != 0) {
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
outResult = GHIDRA_CAST<TypeDescriptor *>((GHIDRA_INT(local_d68) + 0x10));
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0x67126f);
EntityList::QueryRadius
(entityList,GHIDRA_CAST<EntityList_EL *>(outResult),GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x33c)),24.0,4);
ehState = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(ehState)) + 0x1))),10);
local_8b0 = (EntityPtr)0x0;
iVar7 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>((local_d68 + 0x10)))))->EntityList::Size();
if (iVar7 != 0) {
do {
puVar13 = GHIDRA_CAST<undefined4 *>(std)::vector<int>::operator_index();
local_8cc = (EntityPtr)(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*puVar13))))->Entity::ToTear();
if ((local_8cc != (EntityPtr)0x0) && (local_8cc != EVar14)) {
pBVar6 = BitSet128::operator_and
(&ludovicoMask21,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(local_8cc) + 0x428)),
&g_tearFlagLudovico);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if ((bVar4 != 0) &&
(bVar4 = is_not_familiar_spawned(GHIDRA_CAST<Entity_Tear *>(local_8cc)), bVar4 != 0)) {
pVVar9 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_8cc))))->Entity::Position(&entityPos22);
outResult = GHIDRA_CAST<TypeDescriptor *>(0x671317);
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x33c)))))->Vector::__sub(&local_984,pVVar9);
local_87c = (EntityPtr)(GHIDRA_CAST<Vector *>((&local_984)))->Vector::Length();
if (24.0 <= (float)local_87c) {
local_978 = (EntityPtr)zeroConst;
}
else {
fVar27 = (GHIDRA_CAST<Vector *>((&local_984)))->Vector::Length();
local_87c = (EntityPtr)(4.0 / (fVar27 + 1.0));
local_978 = local_87c;
}
bVar4 = (GHIDRA_CAST<Vector *>((&local_984)))->Vector::operator_eq(&g_vectorZero);
if (bVar4 != 0) {
pVVar9 = MusicManager::RandomVector(&randomDir5);
(GHIDRA_CAST<Vector *>((&local_984)))->Vector::operator_assign(pVVar9);
}
if (zeroConst < (float)local_978) {
pVVar9 = (GHIDRA_CAST<Vector *>((&local_984)))->Vector::Normalized(&direction13);
bVar4 = 0;
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0x6713d7);
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__mul(&local_1348,GHIDRA_CAST<float *>(&local_978));
outResult = GHIDRA_CAST<TypeDescriptor *>(0x6713df);
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::AddVelocity_divided(pVVar9,bVar4);
}
}
}
local_8b0 = (EntityPtr)(GHIDRA_INT(local_8b0) + 1);
EVar28 = (EntityPtr)(GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>((local_d68 + 0x10)))))->EntityList::Size();
} while (GHIDRA_UINT(local_8b0) < GHIDRA_UINT(EVar28));
}
ehState = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(ehState)) + 0x1))),9);
(GHIDRA_CAST<EntityList_Query *>((local_d68 + 0x10)))->EntityList_Query::~EntityList_Query();
}
pVVar9 = GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x33c));
pVVar15 = (GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(EVar14) + 0x3bc)))))->Entity::Position(&parentPos8);
local_87c = (EntityPtr)(GHIDRA_CAST<Vector *>((pVVar15)))->Vector::DistanceSquared(pVVar9);
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_888)) + 0x0))) != '\0') {
if ((float)local_87c <= 1600.0) {
ehState = 0xffffffff;
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x36c)) = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x36c)) * 0.9;
FID_conflict__Tidy(local_9e0);
}
else {
pVVar15 = (GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(EVar14) + 0x3bc)))))->Entity::Position(&parentPos9);
pVVar15 = (GHIDRA_CAST<Vector *>((pVVar15)))->Vector::__sub(&local_1360,pVVar9);
pVVar15 = (GHIDRA_CAST<Vector *>((pVVar15)))->Vector::Normalized(&direction14);
bVar4 = 0;
local_afc = 0.1;
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0x6714a7);
pVVar15 = (GHIDRA_CAST<Vector *>((pVVar15)))->Vector::__mul(&local_1370,&local_afc);
outResult = GHIDRA_CAST<TypeDescriptor *>(0x6714af);
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::AddVelocity_divided(pVVar15,bVar4);
ehState = 0xffffffff;
FID_conflict__Tidy(local_9e0);
}
goto LAB_0067176f;
}
bVar4 = (GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(EVar14) + 0x3bc)))))->Entity::is_player();
if (bVar4 != 0) {
outResult = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0x0);
pEVar17 = GHIDRA_CAST<Entity_Player *>(__RTDynamicCast());
bVar4 = (GHIDRA_CAST<Entity_Player *>((pEVar17)))->Entity_Player::HasWeaponType(8);
if (bVar4 == 0) {
EVar28 = (EntityPtr)(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::Child();
while (EVar28 != (EntityPtr)0x0) {
local_87c = (EntityPtr)(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar28))))->Entity::Child();
(**(code **)(*GHIDRA_CAST<int *>(EVar28) + 0x28))();
EVar28 = local_87c;
}
}
}
}
pVVar9 = GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x33c));
ehState = 0xffffffff;
FID_conflict__Tidy(local_9e0);
}
}
LAB_0067176f:
(GHIDRA_CAST<Game *>((g_game)))->Game::GetField26614();
cVar5 = DeathmatchManager::is_active();
if (cVar5 == '\0') {
LAB_006717e1:
local_8a1 = '\0';
}
else {
playerManager = GHIDRA_CAST<PlayerManager *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetPlayerManager();
bVar4 = (GHIDRA_CAST<PlayerManager *>((playerManager)))->PlayerManager::AnyoneHasCollectible(0x1a7);
if (bVar4 == 0) goto LAB_006717e1;
outResult = GHIDRA_CAST<TypeDescriptor *>(0x6717b0);
(GHIDRA_CAST<RNG *>((&local_8c)))->RNG::game_constructor(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x3ec)),0x2c);
ehState = 0xb;
local_8f8 = (EntityPtr)(GHIDRA_UINT(local_8f8) | 1);
local_87c = local_8f8;
uVar10 = (GHIDRA_CAST<RNG *>((laser)))->RNG::RandomInt(100);
local_8a1 = '\x01';
if (0x20 < uVar10) goto LAB_006717e1;
}
ehState = 0xffffffff;
if ((GHIDRA_UINT(local_8f8) & 1) != 0) {
guard_check_icall();
}
if (local_8a1 != '\0') {
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
outResult = GHIDRA_CAST<TypeDescriptor *>(0x3);
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0x8);
EntityList::QuerySublist(entityList,GHIDRA_CAST<EntityList_EL *>(local_d68),7,8,3,1,0);
ehState = 0xc;
local_8f8 = (EntityPtr)0x0;
iVar7 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_d68))))->EntityList::Size();
if (iVar7 != 0) {
while( true ) {
std::vector<int>::operator_index();
outResult = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0x0);
local_8cc = (EntityPtr)__RTDynamicCast();
local_888 = (EntityPtr)(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_8cc))))->Entity::SpawnerEntity();
if ((local_888 != (EntityPtr)0x0) &&
(bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_888))))->Entity::is_player(), bVar4 == 0)) {
local_888 = (EntityPtr)0x0;
}
if (*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(EVar14) + 0x3c8)) != local_888) {
fVar26 = (float10)(GHIDRA_CAST<Entity_Laser *>((GHIDRA_CAST<Entity_Laser *>(local_8cc))))->Entity_Laser::Radius();
local_87c = (EntityPtr)(float)fVar26;
pVVar15 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_8cc))))->Entity::Position(&entityPos23);
local_8ac = (EntityPtr)(GHIDRA_CAST<Vector *>((pVVar9)))->Vector::DistanceSquared(pVVar15);
if ((float)local_8ac < (float)local_87c * (float)local_87c) {
(**(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x28))();
EVar28 = local_888;
if (local_888 == (EntityPtr)0x0) {
(GHIDRA_CAST<TearParams *>((&local_878)))->TearParams::constructor();
other = extraout_EAX;
}
else {
pEVar11 = GHIDRA_CAST<Entity *>(0x0);
iVar7 = Isaac::Random(2);
other = Entity_Player::GetTearHitParams
(GHIDRA_CAST<Entity_Player *>(EVar28),local_810,1,1.0,iVar7 * 2 + -1,pEVar11);
}
(GHIDRA_CAST<TearParams *>((&tearHitParams)))->TearParams::copy(other);
uVar10 = Random();
pVVar9 = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x360)))))->Vector::__unm(&negated3);
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(2,0,GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x33c)),pVVar9,GHIDRA_CAST<Entity *>(local_888),0,
uVar10);
spawnedTear = GHIDRA_CAST<Entity_Tear *>(__RTDynamicCast());
Entity_Projectile::SetHeight
(GHIDRA_CAST<Entity_Projectile *>(spawnedTear),*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x410)));
FUN_00444c70();
spawnedTear->SetCollisionDamage();
SetTearFlags(spawnedTear,g_tearFlagHoming);
SetScale(spawnedTear,tearHitParams._tearScale);
Entity_Projectile::set_falling_accel
(GHIDRA_CAST<Entity_Projectile *>(spawnedTear),(GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x418)))->x);
(GHIDRA_CAST<Color *>(()))->Color::Color();
outResult = GHIDRA_CAST<TypeDescriptor *>(0x0);
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0xff);
spawnedTear->SetColor();
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(spawnedTear))))->Entity::SetParent(GHIDRA_CAST<Entity *>(local_888));
spawnedTear->Update();
}
}
EVar29 = (EntityPtr)(GHIDRA_INT(local_8f8) + 1);
local_8f8 = EVar29;
EVar28 = (EntityPtr)(GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_d68))))->EntityList::Size();
if (GHIDRA_UINT(EVar28) <= GHIDRA_UINT(EVar29)) break;
pVVar9 = GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x33c));
}
}
ehState = 0xffffffff;
(GHIDRA_CAST<EntityList_Query *>((local_d68)))->EntityList_Query::~EntityList_Query();
}
pVVar9 = GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x420));
pVVar9->x = local_8dc * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x424));
local_b00 = 0x3c23d70a;
local_8c0 = (EntityPtr)pVVar9;
pfVar16 = GHIDRA_CAST<float *>(std)::max<float>();
pVVar9->x = *pfVar16;
ResetSpriteScale(GHIDRA_CAST<Entity_Tear *>(EVar14));
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x2c)) == 0x2e) {
pEVar30 = *GHIDRA_CAST<Entity_Projectile **>((GHIDRA_CAST<char *>(EVar14) + 0x454));
local_8ac = (EntityPtr)pEVar30;
if (*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(EVar14) + 0x3c8)) != (EntityPtr)0x0) {
local_87c = (EntityPtr)((float)pEVar30 * pointSixConst);
pVVar9 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(EVar14) + 0x3c8))))))->Entity::Position(&spawnerPos);
local_8cc = (EntityPtr)(GHIDRA_CAST<Vector *>((pVVar9)))->Vector::Distance(GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x33c)));
pEVar30 = (Entity_Projectile *)
assert_lerp_range((float)local_8cc,zeroConst,160.0,(float)local_8ac,(float)local_87c
,1);
}
*GHIDRA_CAST<Entity_Projectile **>((GHIDRA_CAST<char *>(EVar14) + 0x388)) = pEVar30;
local_97c = Math::clamp(pointThreeConst,oneConst,
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x3a4)) / (float)local_8fc);
outResult = GHIDRA_CAST<TypeDescriptor *>(0x671bef);
pVVar9 = (GHIDRA_CAST<Vector *>((&g_vectorOne)))->Vector::__mul(&uniformScale13,&local_97c);
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(EVar14) + 0x48)))))->Sprite::SetScale(pVVar9);
effect = GHIDRA_CAST<Font *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(EVar14) + 0x48)))))->Sprite)::Color();
fVar27 = Math::clamp(zeroConst,pointSixConst,*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x3a4)) / (float)local_8f4)
;
(GHIDRA_CAST<Font *>((effect)))->Font::SetLineHeightModifier(oneConst - fVar27);
local_b04 = 0x3f19999a;
pfVar16 = GHIDRA_CAST<float *>(std)::max<float>();
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x370)) =
*GHIDRA_CAST<float *>((GHIDRA_INT(*(void **)(GHIDRA_CAST<char *>(EVar14) + 0x330)) + 0x38)) * *pfVar16 * 5.0;
}
bVar4 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsInTimedSet(0x25);
if (bVar4 != 0) {
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x3c);
(GHIDRA_CAST<Color *>(()))->Color::Color();
(*pcVar1)();
outResult = GHIDRA_CAST<TypeDescriptor *>(0x0);
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0x3f800000);
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Color *>(()))->Color)::Color();
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(EVar14) + 0x48)))))->Sprite::SetColor(color);
}
prevPos.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x340));
pVVar9 = GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x33c));
prevPos.x = pVVar9->x;
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::Update();
pBVar6 = BitSet128::operator_and
(&bit127Mask,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),GHIDRA_CAST<BitSet128 *>(&DAT_00c346d0));
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
if (*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(EVar14) + 0x3bc)) != (EntityPtr)0x0) {
pBVar6 = BitSet128::operator_and
(&bit125Mask,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),GHIDRA_CAST<BitSet128 *>(&DAT_00c346b0))
;
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (((bVar4 == 0) || (iVar7 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::FrameCount(), iVar7 < 1)) ||
((0 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x83c)) &&
(iVar7 = Entity::GetIntervalTicks
(GHIDRA_CAST<Entity *>(EVar14),(float)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x83c)),zeroConst),
iVar7 == 0)))) {
local_8f4 = GHIDRA_CAST<Entity_Player *>((GHIDRA_INT(EVar14) + 0x360));
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__add(&local_13b8,GHIDRA_CAST<Vector *>(local_8f4));
pVVar15 = GHIDRA_CAST<Vector *>(FUN_004172b0());
(GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__sub(&local_cc8,pVVar15);
local_95c = (GHIDRA_CAST<Vector *>((&local_cc8)))->Vector::Length();
if (local_95c != zeroConst) {
(GHIDRA_CAST<Vector *>((&local_cc8)))->Vector::__div(&local_c88,&local_95c);
fVar27 = (GHIDRA_CAST<Vector *>((&local_c88)))->Vector::GetAngleDegrees();
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x840)) = fVar27;
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(local_8f4))))->Vector::operator__(GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x334)));
bVar4 = 0;
local_b08 = (50.0 - local_95c) * 0.1;
pVVar9 = (GHIDRA_CAST<Vector *>((&local_c88)))->Vector::__mul(local_13c8,&local_b08);
pVVar9 = vector_lerp(&lerped,GHIDRA_CAST<Vector *>(local_8f4),pVVar9,bVar4,pointThreeConst);
pVVar15 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(tear->_parent))))->Entity::Velocity(&parentVel);
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__add(&local_13e0,pVVar15);
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(local_8f4))))->Vector::operator_assign(pVVar9);
pVVar9 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(tear->_parent))))->Entity::Velocity(&parentVel2);
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x334)))))->Vector::operator_assign(pVVar9);
EVar14 = (EntityPtr)tear;
}
fVar27 = Math::lerp(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x410)),-23.0,local_900,0);
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x410)) = fVar27;
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::IsFrame(8,0);
if (bVar4 != 0) {
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x3c);
(GHIDRA_CAST<Color *>((local_438)))->Color::Color(oneConst,oneConst,oneConst,0.35,0.45,0.5);
(GHIDRA_CAST<Color *>((aCStackY_3c4c + 0x81)))->Color::operator_assign(&tear->_color);
FUN_004072e0();
(*pcVar1)();
}
goto LAB_00673502;
}
}
outResult = GHIDRA_CAST<TypeDescriptor *>(Vector)::FromAngle(&angleDir8,*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x840)));
in_stack_ffffd9fc = GHIDRA_CAST<Vector *>(0x67201c);
pVVar15 = Vector::operator_mul(&local_13f8,GHIDRA_CAST<float *>((GHIDRA_INT(EVar14) + 0x838)),GHIDRA_CAST<Vector *>(outResult));
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x360)))))->Vector::operator_assign(pVVar15);
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(EVar14) + 0x840)) = 0x3c75c28f;
}
if (*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(EVar14) + 0x3c4)) != (EntityPtr)0x0) {
pBVar6 = BitSet128::operator_and
(&turnHorizontalMask2,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),
&g_tearFlagTurnHorizontal);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x360)))))->Vector::Normalized(&velDir);
pVVar15 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(EVar14) + 0x3c4))))))->Entity::Position(&targetPos5);
pVVar15 = (GHIDRA_CAST<Vector *>((pVVar15)))->Vector::__sub(&local_1408,&prevPos);
pVVar15 = (GHIDRA_CAST<Vector *>((pVVar15)))->Vector::__sub(&local_1410,GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x360)));
(GHIDRA_CAST<Vector *>((pVVar15)))->Vector::Normalized(&local_d88);
local_8ac = (EntityPtr)(GHIDRA_CAST<Vector *>((&local_d88)))->Vector::Dot(&velDir);
pVVar15 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(EVar14) + 0x3c4))))))->Entity::Position(&targetPos6);
pVVar15 = (GHIDRA_CAST<Vector *>((pVVar15)))->Vector::__sub(&local_1420,pVVar9);
outResult = GHIDRA_CAST<TypeDescriptor *>(0x672114);
pVVar15 = (GHIDRA_CAST<Vector *>((pVVar15)))->Vector::__sub(&local_1428,GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x360)));
(GHIDRA_CAST<Vector *>((pVVar15)))->Vector::Normalized(&local_cd8);
local_87c = (EntityPtr)(GHIDRA_CAST<Vector *>((&local_cd8)))->Vector::Dot(&velDir);
if ((zeroConst < (float)local_87c) ||
(((float)local_8ac <= zeroConst && ((float)local_87c < -0.1)))) {
if (((float)local_87c < -0.1) && ((float)local_8ac < -0.1)) {
pBVar6 = BitSet128::operator_and
(&homingMask5,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagHoming);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsZero();
if (bVar4 != 0) {
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::SetTarget(GHIDRA_CAST<Entity *>(0x0));
}
}
}
else {
pVVar15 = (GHIDRA_CAST<Vector *>((&velDir)))->Vector::Rotated(&perpDir2,90.0);
(GHIDRA_CAST<Vector *>((&velDir)))->Vector::operator_assign(pVVar15);
local_87c = (EntityPtr)(GHIDRA_CAST<Vector *>((&velDir)))->Vector::Dot(&local_cd8);
if ((float)local_87c < zeroConst) {
local_b0c = &DAT_bf800000;
(GHIDRA_CAST<Vector *>((&velDir)))->Vector::operator_mul_assign(GHIDRA_CAST<float *>(&local_b0c));
}
local_b10 = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x360)))))->Vector::Length();
outResult = GHIDRA_CAST<TypeDescriptor *>(0x672206);
pVVar15 = (GHIDRA_CAST<Vector *>((&velDir)))->Vector::__mul(&local_1438,&local_b10);
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x360)))))->Vector::operator_assign(pVVar15);
(GHIDRA_CAST<BitSet128 *>((&g_tearFlagTurnHorizontal)))->BitSet128::__bnot(&notTurnHorizontal);
FUN_005cd430();
}
}
}
pBVar6 = BitSet128::operator_and
(&stickyMask3,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagSticky);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 == 0) {
pBVar6 = BitSet128::operator_and
(&boogerMask2,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagBooger);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 != 0) goto LAB_006722d8;
pBVar6 = BitSet128::operator_and
(&sporeMask3,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagSpore);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 != 0) goto LAB_006722d8;
}
else {
LAB_006722d8:
local_8b0 = (EntityPtr)(GHIDRA_INT(EVar14) + 0x478);
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x478)) == 0) {
if (((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x2c)) == 0x1a) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x2c)) == 0x30)) &&
(bVar4 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(EVar14) + 0x48)))))->ANM2::IsPlaying(&s_empty), bVar4 == 0)) {
pAVar22 = GHIDRA_CAST<ANM2 *>(Config)::GetPillEffects();
psVar21 = (GHIDRA_CAST<ANM2 *>((pAVar22)))->ANM2::GetAnimation(GHIDRA_CAST<std_string *>((local_1d8 + 0x2c)));
ehState = 0x10;
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(EVar14) + 0x48)))))->Sprite::Play(psVar21,0);
ehState = 0xffffffff;
(GHIDRA_CAST<std::string *>((local_1d8 + 0x2c)))->std::string::_Tidy_deallocate();
}
}
else {
cVar5 = (GHIDRA_CAST<Entity *>(()))->Entity::Visible();
if ((cVar5 == '\0') ||
(iVar7 = (GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(EVar14) + 0x478)))))->Entity::EntityCollisionClass(), iVar7 == 0)) {
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>((GHIDRA_INT(EVar14) + 0x478)))))->EntityPtr::SetReference(GHIDRA_CAST<Entity *>(0x0));
(GHIDRA_CAST<std::vector *>(((void *)(GHIDRA_INT(EVar14) + 0x444))))->std::vector::clear(0);
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x2c)) == 0x1a) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x2c)) == 0x30)) {
pAVar22 = GHIDRA_CAST<ANM2 *>(Config)::GetPillEffects();
psVar21 = (GHIDRA_CAST<ANM2 *>((pAVar22)))->ANM2::GetAnimation(&curAnimName);
ehState = 0xd;
outResult = GHIDRA_CAST<TypeDescriptor *>(0x6723d6);
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(EVar14) + 0x48)))))->Sprite::Play(psVar21,0);
ehState = 0xffffffff;
(GHIDRA_CAST<std::string *>((curAnimName._buf)))->std::string::_Tidy_deallocate();
}
}
else {
pVVar15 = (GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(EVar14) + 0x478)))))->Entity::Velocity(&stickTargetVel);
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x360)))))->Vector::operator_assign(pVVar15);
pVVar15 = (GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(EVar14) + 0x478)))))->Entity::Position(&stickTargetPos);
outResult = GHIDRA_CAST<TypeDescriptor *>(0x672353);
pVVar15 = (GHIDRA_CAST<Vector *>((pVVar15)))->Vector::__add(&local_1450,GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x47c)));
(GHIDRA_CAST<Vector *>((pVVar9)))->Vector::operator_assign(pVVar15);
if (((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x2c)) == 0x1a) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x2c)) == 0x30)) &&
(bVar4 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(EVar14) + 0x48)))))->ANM2::IsPlaying(&s_empty), bVar4 != 0)) {
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(EVar14) + 0x48)))))->Sprite::Stop();
}
}
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x484)) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x484)) + -1;
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x484)) < 1) {
*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(EVar14) + 0x173)) = 1;
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(EVar14) + 0x474)) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(EVar14) + 0x474)) | 0x40;
(GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x420)))->x = (float)local_8b4 * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x424));
local_b14 = 0x3c23d70a;
pfVar16 = GHIDRA_CAST<float *>(std)::max<float>();
(GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x420)))->x = *pfVar16;
ResetSpriteScale(GHIDRA_CAST<Entity_Tear *>(EVar14));
pBVar6 = BitSet128::operator_and
(&stickyMask4,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagSticky);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
uVar37 = 0x83;
uVar38 = 0x24;
uVar39 = 0x67;
(GHIDRA_CAST<BitSet128 *>((GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)))))->BitSet128::operator__(&g_tearFlagExplosive);
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(EVar14) + 0x474)) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(EVar14) + 0x474)) | 0x20;
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x388)) = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x388)) + 60.0;
local_8f4 = GetRootPlayer(GHIDRA_CAST<Entity_Tear *>(EVar14));
if (local_8f4 != GHIDRA_CAST<Entity_Player *>(0x0)) {
uVar20 = 0;
FUN_00435bc0();
Entity_Player::GetBombVariant();
FUN_00435bc0();
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlags._l)) + 0x4))) = (EntityPtr)outResult;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlags._l)) + 0x0))) = (EntityPtr)in_stack_ffffd9fc;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(tearFlags._h)) + 0x0))) = uVar37;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(tearFlags._h)) + 0x1))) = uVar38;
(*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(&(tearFlags._h)) + 0x2))) = uVar39;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlags._h)) + 0x4))) = uVar20;
fVar27 = (GHIDRA_CAST<Entity_Player *>((local_8f4)))->Entity_Player::check_bomb_tearflags(tearFlags);
if (1.5 <= fVar27) {
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x388)) = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x388)) + 50.0;
}
}
}
pBVar6 = BitSet128::operator_and
(&sporeMask4,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagSpore);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
EVar29 = (EntityPtr)GetRootPlayer(GHIDRA_CAST<Entity_Tear *>(EVar14));
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Color *>(()))->Color)::Color();
EVar28 = EVar14;
if (EVar29 != (EntityPtr)0x0) {
EVar28 = EVar29;
}
pVVar9 = GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x33c));
(GHIDRA_CAST<Game *>((g_game)))->Game::Fart(pVVar9,85.0,GHIDRA_CAST<Entity *>(EVar28),1.0,0,color);
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x478)) != 0) {
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::HasEntityFlags(0x80000000000);
if (bVar4 == 0) {
iVar7 = Isaac::Random(3);
local_8ec = (float)(iVar7 + 2);
}
else {
local_8ec = (float)Isaac::Random(2);
}
fVar27 = random_float();
local_87c = (EntityPtr)(fVar27 * 360.0);
FUN_00424510();
ehState = 0xe;
FUN_00431620();
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
entityList = GHIDRA_CAST<EntityList *>(FUN_00428a60());
EntityList::QueryRadius(entityList,GHIDRA_CAST<EntityList_EL *>(radiusQuery200),pVVar9,200.0,8);
ehState = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(ehState)) + 0x1))),0xf);
local_8f8 = (EntityPtr)0x0;
if (0 < GHIDRA_INT(local_8ec)) {
local_8e0 = GHIDRA_CAST<Entity_Player *>((GHIDRA_INT(EVar14) + 0x360));
do {
fVar27 = local_8ec;
fVar23 = random_float();
Vector::FromAngle(&local_b8c,
((fVar23 * 0.8 + ((float)GHIDRA_INT(local_8f8) - local_900)) * 360.0) /
(float)GHIDRA_INT(fVar27) + (float)local_87c);
local_8fc = (EntityPtr)0x0;
local_8f4 = GHIDRA_CAST<Entity_Player *>(0x4e6e6b28);
local_8ac = (EntityPtr)0x0;
iVar7 = (GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(radiusQuery200))))->EntityList::Size();
if (iVar7 != 0) {
EVar14 = local_8ac;
do {
pEVar19 = GHIDRA_CAST<EntityPtr *>(std)::vector<int>::operator_index();
EVar28 = *pEVar19;
local_8cc = EVar28;
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar28))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
if (((bVar4 != 0) &&
(bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar28))))->Entity::HasEntityFlags(0x20000000), bVar4 == 0))
&& (bVar4 = EntityList::HitListContains
(GHIDRA_CAST<EntityList *>(local_c80),GHIDRA_CAST<Entity *>(EVar28)), bVar4 == 0)
) {
local_b18 = 200.0;
pVVar9 = Vector::operator_mul(&local_1458,&local_b18,&local_b8c);
pVVar9 = (GHIDRA_CAST<Vector *>((tearPos)))->Vector::__add(&local_1460,pVVar9);
pVVar15 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(local_8cc))))->Entity::Position(&entityPos24);
local_8ac = (EntityPtr)(GHIDRA_CAST<Vector *>((pVVar9)))->Vector::DistanceSquared(pVVar15);
if ((float)local_8ac < (float)local_8f4) {
local_8fc = local_8cc;
local_8f4 = GHIDRA_CAST<Entity_Player *>(local_8ac);
}
}
EVar28 = local_8fc;
EVar14 = (EntityPtr)(GHIDRA_INT(EVar14) + 1);
fVar27 = (float)(GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(radiusQuery200))))->EntityList::Size();
spawnedTear = tear;
} while (GHIDRA_UINT(EVar14) < GHIDRA_UINT(fVar27));
if (EVar28 != (EntityPtr)0x0) {
FUN_00431620();
pVVar9 = GHIDRA_CAST<Vector *>(FUN_006b6e40());
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__sub(local_1478,&spawnedTear->_pos);
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::Normalized(&direction15);
(GHIDRA_CAST<Vector *>((&local_b8c)))->Vector::operator_assign(pVVar9);
}
}
uVar10 = Random();
local_8ac = tear->_spawnerEntity;
fVar27 = random_float();
local_b1c = fVar27 * 4.0 + 8.0;
pVVar9 = (GHIDRA_CAST<Vector *>((&local_b8c)))->Vector::__mul(&local_1488,&local_b1c);
pVVar15 = (GHIDRA_CAST<Vector *>((tearPos)))->Vector::__sub(&local_1490,GHIDRA_CAST<Vector *>(local_8e0));
local_8d0 = (EntityPtr)
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(tear->_type,tear->_variant,pVVar15,pVVar9,
GHIDRA_CAST<Entity *>(local_8ac),0,uVar10);
(GHIDRA_CAST<Entity_Projectile *>((GHIDRA_CAST<Entity_Projectile *>(local_8d0))))->Entity_Projectile::SetHeight(-23.75);
local_8cc = (EntityPtr)(GHIDRA_CAST<BitSet128 *>((&g_tearFlagHydrobounce)))->BitSet128::__bnot(&notHydrobounce2);
local_8f4 = GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<BitSet128 *>((&g_tearFlagAbsorb)))->BitSet128)::__bnot(&notAbsorb3);
local_8ac = (EntityPtr)(GHIDRA_CAST<BitSet128 *>((&g_tearFlagBone)))->BitSet128::__bnot(&notBone2);
pBVar6 = (GHIDRA_CAST<BitSet128 *>((&g_tearFlagLudovico)))->BitSet128::__bnot(&notLudovico2);
pBVar8 = (GHIDRA_CAST<BitSet128 *>((&g_tearFlagSplit)))->BitSet128::__bnot(&notSplit2);
pBVar35 = (GHIDRA_CAST<BitSet128 *>((&g_tearFlagQuadsplit)))->BitSet128::__bnot(&notQuadsplit2);
pBVar35 = BitSet128::operator_and(&andResult26,tearFlagsPtr,pBVar35);
pBVar8 = BitSet128::operator_and(&andResult27,pBVar35,pBVar8);
pBVar6 = BitSet128::operator_and(&andResult28,pBVar8,pBVar6);
pBVar6 = BitSet128::operator_and(&andResult29,pBVar6,GHIDRA_CAST<BitSet128 *>(local_8ac));
pBVar6 = BitSet128::operator_and(&andResult30,pBVar6,GHIDRA_CAST<BitSet128 *>(local_8f4));
BitSet128::operator_and(&inheritedFlags2,pBVar6,GHIDRA_CAST<BitSet128 *>(local_8cc));
pBVar8 = &g_tearFlagHoming;
pBVar6 = BitSet128::operator_or
(&withSpectral,&g_tearFlagPiercing,&g_tearFlagSpectral);
pBVar6 = BitSet128::operator_or(&orResult14,pBVar6,pBVar8);
(GHIDRA_CAST<BitSet128 *>((&inheritedFlags2)))->BitSet128::operator__(pBVar6);
EVar14 = local_8d0;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags_03._l)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(inheritedFlags2._l)) + 0x4)));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags_03._l)) + 0x0))) = (undefined4)inheritedFlags2._l;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(flags_03._h)) + 0x0))) = (char)(undefined4)inheritedFlags2._h;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(flags_03._h)) + 0x1))) = (char)(GHIDRA_UINT((undefined4)inheritedFlags2._h) >> 8);
(*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(&(flags_03._h)) + 0x2))) = (short)(GHIDRA_UINT((undefined4)inheritedFlags2._h) >> 0x10);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags_03._h)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(inheritedFlags2._h)) + 0x4)));
SetTearFlags(GHIDRA_CAST<Entity_Tear *>(local_8d0),flags_03);
SetScale(GHIDRA_CAST<Entity_Tear *>(EVar14),*GHIDRA_CAST<float *>(local_8c0) * 0.2);
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x3c);
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(local_8a0))))->Sprite::Color();
(*pcVar1)();
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::SetParent(GHIDRA_CAST<Entity *>(tear->_parent));
FUN_00431620();
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::AddEntityFlags(0x80000000000);
(**(code **)(*GHIDRA_CAST<int *>(EVar14) + 0xc))();
local_8f8 = (EntityPtr)(GHIDRA_INT(local_8f8) + 1);
} while (GHIDRA_INT(local_8f8) < GHIDRA_INT(local_8ec));
pVVar9 = tearPos;
EVar14 = (EntityPtr)tear;
}
(GHIDRA_CAST<EntityList_Query *>((radiusQuery200)))->EntityList_Query::~EntityList_Query();
ehState = 0xffffffff;
FID_conflict__Tidy(local_c80);
}
}
}
}
}
pBVar6 = BitSet128::operator_and
(&boogerMask3,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagBooger);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (((bVar4 != 0) &&
(bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::IsFrame(0x1e,*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x20))), bVar4 != 0)) &&
((*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(EVar14) + 0x478)) != GHIDRA_CAST<Entity *>(0x0) &&
(bVar4 = (GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(EVar14) + 0x478)))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0)),
bVar4 != 0)))) {
FUN_00665a90();
}
pBVar6 = BitSet128::operator_and
(&ludovicoMask22,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagLudovico);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if ((bVar4 != 0) && (bVar4 = is_not_familiar_spawned(GHIDRA_CAST<Entity_Tear *>(EVar14)), bVar4 != 0)) {
pBVar6 = BitSet128::operator_and
(&continuumMask,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagContinuum);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsZero();
if (bVar4 != 0) {
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
pVVar15 = (GHIDRA_CAST<Room *>((room)))->Room::GetClampedPosition(&clampedPos3,pVVar9,0.0);
(GHIDRA_CAST<Vector *>((pVVar9)))->Vector::operator_assign(pVVar15);
}
}
pBVar6 = BitSet128::operator_and
(&bit126Mask,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),GHIDRA_CAST<BitSet128 *>(&DAT_00c346c0));
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if ((bVar4 != 0) &&
(((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x83c)) < 1 ||
(iVar7 = Entity::GetIntervalTicks
(GHIDRA_CAST<Entity *>(EVar14),(float)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x83c)),zeroConst),
iVar7 != 0)) && (iVar7 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::FrameCount(), 0 < iVar7)))) {
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x360)))))->Vector::Resize(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x838)));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(bit125Flags._l)) + 0x0))) = _DAT_00c346b0;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(bit125Flags._l)) + 0x4))) = uRam00c346b4;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(bit125Flags._h)) + 0x0))) = uRam00c346b8;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(bit125Flags._h)) + 0x4))) = uRam00c346bc;
pBVar6 = BitSet128::operator_and(&andResult31,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x828)),&bit125Flags);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 != 0) {
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(bit126Flags._l)) + 0x0))) = _DAT_00c346c0;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(bit126Flags._l)) + 0x4))) = uRam00c346c4;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(bit126Flags._h)) + 0x0))) = uRam00c346c8;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(bit126Flags._h)) + 0x4))) = uRam00c346cc;
pBVar6 = BitSet128::operator_and(&andResult32,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x828)),&bit126Flags)
;
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 != 0) goto LAB_00672d53;
}
pBVar6 = (GHIDRA_CAST<BitSet128 *>((GHIDRA_CAST<BitSet128 *>(&DAT_00c346c0))))->BitSet128::__bnot(&notBit126);
pBVar6 = BitSet128::operator_and(&andResult33,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),pBVar6);
uVar20 = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&pBVar6->_l) + 4));
qVar2 = pBVar6->_h;
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar6->_h) + 4));
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x428)) = GHIDRA_INT(pBVar6->_l);
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(EVar14) + 0x42c)) = uVar20;
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x430)) = GHIDRA_INT(qVar2);
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x434)) = iVar7;
}
LAB_00672d53:
pBVar6 = BitSet128::operator_and
(&bit125Mask2,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),GHIDRA_CAST<BitSet128 *>(&DAT_00c346b0));
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (((bVar4 != 0) && (iVar7 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::FrameCount(), 0 < iVar7)) &&
((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x83c)) < 1 ||
(iVar7 = Entity::GetIntervalTicks
(GHIDRA_CAST<Entity *>(EVar14),(float)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x83c)),zeroConst),
iVar7 != 0)))) {
(GHIDRA_CAST<BitSet128 *>((GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)))))->BitSet128::IsNonZero();
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x428)) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x828));
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(EVar14) + 0x42c)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(EVar14) + 0x82c));
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(EVar14) + 0x430)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(EVar14) + 0x830));
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x434)) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x834));
FUN_00435bc0();
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(EVar14) + 0x828)) = local_1580;
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(EVar14) + 0x82c)) = uStack_157c;
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(EVar14) + 0x830)) = uStack_1578;
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(EVar14) + 0x834)) = uStack_1574;
}
pVVar15 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__sub(&local_14a0,&prevPos);
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x7ec)))))->Vector::operator_assign(pVVar15);
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x438)) < 1) {
pBVar6 = BitSet128::operator_and
(&ludovicoMask23,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagLudovico);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsZero();
if (((bVar4 != 0) && (*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(EVar14) + 0x173)) == 0)) &&
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x478)) == 0)) {
pBVar6 = BitSet128::operator_and
(&chainMask2,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagChain);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsZero();
if (bVar4 != 0) {
pBVar6 = BitSet128::operator_and
(&popMask2,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagPop);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsZero();
if (((bVar4 != 0) || (8 < *GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(EVar14) + 0x46c)))) ||
(local_87c = (EntityPtr)(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x360)))))->Vector::LengthSquared(),
(float)local_87c < 0.01)) {
pBVar6 = BitSet128::operator_and
(&fetusMask4,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagFetus);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 == 0) {
fVar23 = Math::timescale_factor(0.9,*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x39c)));
fVar27 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x39c));
pvVar34 = (void *)(fVar27 * 0.1 +
fVar23 * (float)(GHIDRA_CAST<NPCAI_Pathfinder *>((GHIDRA_INT(EVar14) + 0x414)))->_entity
+ fVar27 * (GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x418)))->x);
}
else if (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x3a4)) <=
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x820)) * (float)local_904) {
fVar27 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x39c));
pvVar34 = (void *)zeroConst;
}
else {
local_b20 = (GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x418)))->x + 0.2;
local_b24 = 0;
local_87c = (EntityPtr)(GHIDRA_CAST<NPCAI_Pathfinder *>((GHIDRA_INT(EVar14) + 0x414)))->_entity;
fVar27 = Math::timescale_factor(0.9,*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x39c)));
local_87c = (EntityPtr)(fVar27 * (float)local_87c);
pfVar16 = GHIDRA_CAST<float *>(std)::max<float>();
fVar27 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x39c));
pvVar34 = (void *)(fVar27 * *pfVar16 + (float)local_87c);
}
(GHIDRA_CAST<NPCAI_Pathfinder *>((GHIDRA_INT(EVar14) + 0x414)))->_entity = pvVar34;
Entity_Projectile::SetHeight
(GHIDRA_CAST<Entity_Projectile *>(EVar14),
fVar27 * (float)pvVar34 + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x410)));
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
bVar4 = (GHIDRA_CAST<Room *>((room)))->Room::is_type_16();
if (bVar4 != 0) {
pBVar6 = BitSet128::operator_and
(&fetusMask5,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagFetus);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 == 0) {
fVar27 = (GHIDRA_CAST<Vector *>((GHIDRA_INT(EVar14) + 0x418)))->x;
if (fVar27 < 0.001) {
if (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x410)) <= (float)local_8e4) goto LAB_0067308c;
fVar27 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x364)) + halfConst;
}
else {
fVar27 = fVar27 + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x364));
}
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x364)) = fVar27;
}
LAB_0067308c:
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
bVar4 = (GHIDRA_CAST<Room *>((room)))->Room::IsBeastDungeon();
if (((bVar4 != 0) && (iVar7 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::FrameCount(), 2 < iVar7)) &&
(fVar27 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x364)), zeroConst < fVar27)) {
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurrentRoom();
Room::get_lava_line_y();
if (fVar27 < *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar14) + 0x340))) {
pBVar6 = BitSet128::operator_and
(&explosiveMask6,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),
&g_tearFlagExplosive);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 == 0) {
(**(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x28))();
uVar10 = Random();
pEVar11 = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x10,pVVar9,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0x42,
uVar10);
pEVar11->Update();
}
else {
*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(EVar14) + 0x173)) = 1;
}
}
}
}
}
}
}
}
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
bVar4 = (GHIDRA_CAST<Room *>((room)))->Room::is_type_16();
if (bVar4 != 0) {
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
bVar4 = (GHIDRA_CAST<Room *>((room)))->Room::IsPositionInRoom(pVVar9,-256.0);
if (bVar4 == 0) {
(**(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x28))();
}
}
pBVar6 = BitSet128::operator_and
(&continuumMask2,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagContinuum);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if (bVar4 == 0) goto LAB_006734ab;
pBVar6 = BitSet128::operator_and
(&ludovicoMask24,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagLudovico);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsZero();
if ((bVar4 == 0) && (bVar4 = is_not_familiar_spawned(GHIDRA_CAST<Entity_Tear *>(EVar14)), bVar4 == 0))
goto LAB_006734ab;
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
(GHIDRA_CAST<Room *>((room)))->Room::ScreenWrapPosition(&wrappedPos,pVVar9,-100.0);
(GHIDRA_CAST<Vector *>((&wrappedPos)))->Vector::__sub(&wrapDelta,pVVar9);
bVar4 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::operator_ne(&wrappedPos);
if (bVar4 != 0) {
pBVar6 = BitSet128::operator_and
(&tractorBeamMask3,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagTractorBeam)
;
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if ((bVar4 != 0) && (*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(EVar14) + 0x3bc)) != (EntityPtr)0x0)) {
pVVar15 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(*GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(EVar14) + 0x3bc))))))->Entity::Position(&parentPos10);
(GHIDRA_CAST<Vector *>((&wrappedPos)))->Vector::operator_assign(pVVar15);
}
}
(GHIDRA_CAST<Vector *>((pVVar9)))->Vector::operator_assign(&wrappedPos);
pBVar6 = BitSet128::operator_and
(&ludovicoMask25,GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(EVar14) + 0x428)),&g_tearFlagLudovico);
bVar4 = (GHIDRA_CAST<BitSet128 *>((pBVar6)))->BitSet128::IsNonZero();
if ((bVar4 != 0) && (bVar4 = is_not_familiar_spawned(GHIDRA_CAST<Entity_Tear *>(EVar14)), bVar4 != 0)) {
for (EVar28 = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(EVar14) + 0x3c0)); EVar28 != (EntityPtr)0x0;
EVar28 = (EntityPtr)(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar28))))->Entity::Child()) {
pVVar9 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar28))))->Entity::Position(&entityPos25);
pVVar9 = (GHIDRA_CAST<Vector *>((pVVar9)))->Vector::__add(&local_14b8,&wrapDelta);
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar28))))->Entity::SetPosition(pVVar9);
}
}
bVar4 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::IsFrame(2,*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar14) + 0x20)));
if (bVar4 == 0) goto LAB_006734ab;
iVar7 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(EVar14))))->Entity::FrameCount();
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>((local_7c + 0x2c)))))->Color::Color();
switch((iVar7 / 2) % 9) {
case 0:
fVar27 = 0.33;
goto LAB_00673484;
case 1:
fVar27 = 0.66;
goto LAB_00673484;
case 2:
fVar27 = 1.0;
goto LAB_00673484;
case 3:
uVar37 = 0xc3;
uVar38 = 0xf5;
uVar39 = 0x3f28;
fVar27 = 0.66;
fVar23 = 0.66;
break;
case 4:
uVar37 = 0xc3;
uVar38 = 0xf5;
uVar39 = 0x3ea8;
fVar27 = 0.33;
fVar23 = 0.33;
break;
case 5:
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>((local_7c + 0x2c)))))->Color::SetTint(0.0,0.0,0.0,1.0);
goto LAB_00673493;
case 6:
uVar37 = 0xc3;
uVar38 = 0xf5;
uVar39 = 0x3ea8;
fVar27 = 0.0;
fVar23 = 0.33;
break;
case 7:
uVar37 = 0xc3;
uVar38 = 0xf5;
uVar39 = 0x3f28;
fVar27 = 0.0;
fVar23 = 0.66;
break;
case 8:
fVar27 = 0.0;
LAB_00673484:
uVar39 = 0x3f80;
uVar38 = 0;
uVar37 = 0;
fVar23 = 1.0;
break;
default:
goto LAB_00673493;
}
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>((local_7c + 0x2c)))))->Color::SetColorize(fVar23,fVar27,
(float)CONCAT22(uVar39,CONCAT11(uVar38,uVar37)),1.0);
LAB_00673493:
(**(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x3c))();
LAB_006734ab:
room = GHIDRA_CAST<Room *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetCurrentRoom();
cVar5 = (GHIDRA_CAST<Room *>((room)))->Room::HasSlowDown();
if (cVar5 != '\0') {
pcVar1 = *(code **)(*GHIDRA_CAST<int *>(EVar14) + 0x3c);
(GHIDRA_CAST<Color *>(()))->Color::Color();
(*pcVar1)();
}
LAB_00673502:
FUN_00862aa0();
ExceptionList = prevExceptionList;
return;
}
// 00676020
float Entity_Tear::get_height_offset_y(float height)
{
int iVar1;
byte isGFuel;
float heightAboveFloor;
iVar1 = this->_variant;
if ((iVar1 != 0x2e) &&
(((iVar1 != 0x2f && (iVar1 != 0x31)) ||
((0.001 < this->_fallingAccel && (this->_isHovering == 0)))))) {
if ((((iVar1 == 0xd) || (iVar1 == 0x17)) &&
(isGFuel = (GHIDRA_CAST<Seeds *>((&g_game->_seedEffects)))->Seeds::HasSeedEffect(0x4f), isGFuel != 0)) &&
((this->_fallingAccel <= 0.001 || (this->_isHovering != 0)))) {
return -12.0;
}
if ((this->_fallingAccel <= 0.001) || (this->_isHovering != 0)) {
heightAboveFloor = this->_height + 8.5;
if (heightAboveFloor <= 0.0) {
heightAboveFloor = 0.0;
}
height = (this->_height * 0.4 - 15.0) + heightAboveFloor * heightAboveFloor;
}
return height;
}
return -8.0;
}
// 00676120
void Entity_Tear::SetScale(float scale)
{
if (scale <= 0.01) {
scale = 0.01;
}
this->_baseScale = scale;
this->_fScale = scale;
ResetSpriteScale(this);
return;
}
// 00676150
void Entity_Tear::SetTearFlags(BitSet128 flags)
{
byte bVar1;
BitSet128 *maskedFlags;
LayerState *layer;
byte *pbVar2;
int blendDst;
char *freeBlock;
byte *expectedNameCh;
uint uVar3;
bool bVar4;
byte *pbVar5;
byte *layerIdx;
std_string anm2Path;
undefined4 local_58 [5];
undefined1 local_44 [12];
float local_38;
float fStack_34;
float local_30;
uint local_24;
undefined1 *puStack_20;
void *local_1c;
undefined1 *puStack_18;
undefined4 local_14;
int *anmBitflags;
puStack_20 = local_44 + 0x40;
local_14 = 0xffffffff;
puStack_18 = &LAB_00af7975;
local_1c = ExceptionList;
local_24 = __security_cookie ^ GHIDRA_UINT((local_44 + 0x34));
ExceptionList = &local_1c;
maskedFlags = BitSet128::operator_and(GHIDRA_CAST<BitSet128 *>((local_44 + 4)),&flags,&g_tearFlagGlow);
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)) &&
((this->_tearHaloANM2)._loaded == 0)) {
fStack_34 = 0.0;
local_30 = 2.10195e-44;
local_44[0] = '\0';
local_44[1] = '\0';
local_44[2] = '\0';
local_44[3] = '\0';
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_44)) + 0x0))) = std::_Allocate(0x20);
fStack_34 = 2.38221e-44;
local_30 = 4.34403e-44;
builtin_strncpy((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_44))) + 0x0))),"gfx/TearHalo.anm2",0x12);
local_14 = 0;
(GHIDRA_CAST<ANM2 *>((&this->_tearHaloANM2)))->ANM2::Load(GHIDRA_CAST<std_string *>(local_44),1);
local_14 = 0xffffffff;
if (0xf < GHIDRA_UINT(local_30)) {
uVar3 = GHIDRA_INT(local_30) + 1;
freeBlock = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_44))) + 0x0)));
if (0xfff < uVar3) {
freeBlock = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_44)) + 0x0))) + -4));
uVar3 = GHIDRA_INT(local_30) + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_44)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(freeBlock,uVar3);
}
(GHIDRA_CAST<ANM2 *>((&this->_tearHaloANM2)))->ANM2::Play(s_Idle,0);
}
if ((this->_tearEffectANM2)._loaded != 0) goto LAB_00676b9b;
maskedFlags = BitSet128::operator_and(GHIDRA_CAST<BitSet128 *>((local_44 + 4)),&flags,&g_tearFlagHorn);
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)) {
fStack_34 = 0.0;
local_30 = 2.10195e-44;
local_44[0] = '\0';
local_44[1] = '\0';
local_44[2] = '\0';
local_44[3] = '\0';
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_44)) + 0x0))) = std::_Allocate(0x20);
fStack_34 = 4.06377e-44;
local_30 = 4.34403e-44;
builtin_strncpy((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_44))) + 0x0))),"gfx/LittleHornTearEffect.anm2",0x1e);
local_14 = 1;
(GHIDRA_CAST<ANM2 *>((&this->_tearEffectANM2)))->ANM2::Load(GHIDRA_CAST<std_string *>(local_44),1);
local_14 = 0xffffffff;
if (0xf < GHIDRA_UINT(local_30)) {
uVar3 = GHIDRA_INT(local_30) + 1;
freeBlock = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_44))) + 0x0)));
if (0xfff < uVar3) {
freeBlock = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_44)) + 0x0))) + -4));
uVar3 = GHIDRA_INT(local_30) + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_44)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(freeBlock,uVar3);
}
layerIdx = GHIDRA_CAST<byte *>(0x0);
if ((this->_tearEffectANM2)._layerCount != 0) {
do {
uVar3 = g_graphicsManager_flags;
layer = (GHIDRA_CAST<ANM2 *>((&this->_tearEffectANM2)))->ANM2::GetLayer(layerIdx);
blendDst = 1;
if ((uVar3 & 4) == 0) {
blendDst = 6;
}
layer->_blendMode[0] = 0;
layer->_blendMode[1] = blendDst;
layer->_blendMode[2] = 1;
layer->_blendMode[3] = 1;
layer->_blendMode[4] = 1;
layerIdx = layerIdx + 1;
} while (layerIdx < GHIDRA_CAST<byte *>((this->_tearEffectANM2)._layerCount));
}
pbVar5 = (this->_tearEffectANM2)._animState._animData;
if (pbVar5 != GHIDRA_CAST<byte *>(0x0)) {
if (0xf < *GHIDRA_CAST<uint *>((pbVar5 + 0x14))) {
pbVar5 = *GHIDRA_CAST<byte **>(pbVar5);
}
pbVar2 = s_Idle;
do {
bVar1 = *pbVar5;
bVar4 = bVar1 < *pbVar2;
if (bVar1 != *pbVar2) {
LAB_00676b65:
uVar3 = -GHIDRA_UINT(bVar4) | 1;
goto LAB_00676b6a;
}
if (bVar1 == 0) break;
bVar1 = pbVar5[1];
bVar4 = bVar1 < pbVar2[1];
if (bVar1 != pbVar2[1]) goto LAB_00676b65;
pbVar5 = pbVar5 + 2;
pbVar2 = pbVar2 + 2;
} while (bVar1 != 0);
uVar3 = 0;
LAB_00676b6a:
if ((uVar3 == 0) &&
((*GHIDRA_CAST<char *>((GHIDRA_INT((this->_tearEffectANM2)._animState._animData) + 0x34)) == '\0' ||
((this->_tearEffectANM2)._animState._isPlaying != 0)))) goto LAB_00676b9b;
}
bVar1 = (GHIDRA_CAST<ANM2 *>((&this->_tearEffectANM2)))->ANM2::SetAnimation(s_Idle,1);
if (bVar1 != 0) {
(GHIDRA_CAST<AnimationState *>((&(this->_tearEffectANM2)._animState)))->AnimationState::Rewind();
(this->_tearEffectANM2)._animState._isPlaying = 1;
}
goto LAB_00676b9b;
}
maskedFlags = BitSet128::operator_and(GHIDRA_CAST<BitSet128 *>((local_44 + 4)),&flags,&g_tearFlagRift);
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)) {
maskedFlags = BitSet128::operator_and
(GHIDRA_CAST<BitSet128 *>((local_44 + 4)),&flags,&g_tearFlagLightFromHeaven);
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)) {
maskedFlags = BitSet128::operator_and(GHIDRA_CAST<BitSet128 *>((local_44 + 4)),&flags,&g_tearFlagJacobs);
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)) {
maskedFlags = BitSet128::operator_and
(GHIDRA_CAST<BitSet128 *>((local_44 + 4)),&flags,&g_tearFlagMysteriousLiquidCreep
);
bVar1 = (GHIDRA_CAST<BitSet128 *>((maskedFlags)))->BitSet128::IsNonZero();
if (bVar1 != 0) {
fStack_34 = 0.0;
local_30 = 2.10195e-44;
local_44[0] = '\0';
local_44[1] = '\0';
local_44[2] = '\0';
local_44[3] = '\0';
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_44)) + 0x0))) = std::_Allocate(0x20);
fStack_34 = 4.06377e-44;
local_30 = 4.34403e-44;
builtin_strncpy((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_44))) + 0x0))),"gfx/MysteriousTearEffect.anm2",0x1e);
local_14 = 5;
(GHIDRA_CAST<ANM2 *>((&this->_tearEffectANM2)))->ANM2::Load(GHIDRA_CAST<std_string *>(local_44),1);
local_14 = 0xffffffff;
if (0xf < GHIDRA_UINT(local_30)) {
uVar3 = GHIDRA_INT(local_30) + 1;
freeBlock = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_44))) + 0x0)));
if (0xfff < uVar3) {
freeBlock = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_44)) + 0x0))) + -4));
uVar3 = GHIDRA_INT(local_30) + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_44)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(freeBlock,uVar3);
}
anmBitflags = &(this->_tearEffectANM2)._bitflags;
*anmBitflags = *anmBitflags | 0x3000;
layer = (GHIDRA_CAST<ANM2 *>((&this->_tearEffectANM2)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x0));
pbVar5 = GHIDRA_CAST<byte *>(0x1);
layer->_bitflags = 0x1000;
goto LAB_00676426;
}
maskedFlags = BitSet128::operator_and(GHIDRA_CAST<BitSet128 *>((local_44 + 4)),&flags,&g_tearFlagBurn);
bVar1 = (GHIDRA_CAST<BitSet128 *>((maskedFlags)))->BitSet128::IsNonZero();
if (bVar1 == 0) {
maskedFlags = BitSet128::operator_and
(GHIDRA_CAST<BitSet128 *>((local_44 + 4)),&flags,&g_tearFlagDarkMatter);
bVar1 = (GHIDRA_CAST<BitSet128 *>((maskedFlags)))->BitSet128::IsNonZero();
if (bVar1 == 0) goto LAB_00676b9b;
(GHIDRA_CAST<std::string *>((anm2Path._buf)))->std::string::string_from_cstr(GHIDRA_CAST<byte *>("gfx/DarkMatterTearEffect.anm2"));
local_14 = 7;
(GHIDRA_CAST<ANM2 *>((&this->_tearEffectANM2)))->ANM2::Load(&anm2Path,1);
local_14 = 0xffffffff;
(GHIDRA_CAST<std::string *>((anm2Path._buf)))->std::string::_Tidy_deallocate();
}
else {
fStack_34 = 0.0;
local_30 = 2.10195e-44;
local_44[0] = '\0';
local_44[1] = '\0';
local_44[2] = '\0';
local_44[3] = '\0';
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_44)) + 0x0))) = std::_Allocate(0x20);
fStack_34 = 3.78351e-44;
local_30 = 4.34403e-44;
builtin_strncpy((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_44))) + 0x0))),"gfx/FireMindTearEffect.anm2",0x1c);
local_14 = 6;
(GHIDRA_CAST<ANM2 *>((&this->_tearEffectANM2)))->ANM2::Load(GHIDRA_CAST<std_string *>(local_44),1);
local_14 = 0xffffffff;
if (0xf < GHIDRA_UINT(local_30)) {
uVar3 = GHIDRA_INT(local_30) + 1;
freeBlock = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_44))) + 0x0)));
if (0xfff < uVar3) {
freeBlock = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_44)) + 0x0))) + -4));
uVar3 = GHIDRA_INT(local_30) + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_44)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(freeBlock,uVar3);
}
}
anmBitflags = &(this->_tearEffectANM2)._bitflags;
*anmBitflags = *anmBitflags | 0x3000;
layer = (GHIDRA_CAST<ANM2 *>((&this->_tearEffectANM2)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x0));
layer->_bitflags = 0x1000;
}
else {
fStack_34 = 0.0;
local_30 = 2.10195e-44;
local_44[0] = '\0';
local_44[1] = '\0';
local_44[2] = '\0';
local_44[3] = '\0';
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_44)) + 0x0))) = std::_Allocate(0x20);
fStack_34 = 4.34403e-44;
local_30 = 4.34403e-44;
builtin_strncpy((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_44))) + 0x0))),"gfx/JacobsLadderTearEffect.anm2",0x20);
local_14 = 4;
(GHIDRA_CAST<ANM2 *>((&this->_tearEffectANM2)))->ANM2::Load(GHIDRA_CAST<std_string *>(local_44),1);
local_14 = 0xffffffff;
if (0xf < GHIDRA_UINT(local_30)) {
uVar3 = GHIDRA_INT(local_30) + 1;
freeBlock = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_44))) + 0x0)));
if (0xfff < uVar3) {
freeBlock = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_44)) + 0x0))) + -4));
uVar3 = GHIDRA_INT(local_30) + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_44)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(freeBlock,uVar3);
}
pbVar5 = GHIDRA_CAST<byte *>(0x0);
LAB_00676426:
uVar3 = g_graphicsManager_flags;
layer = (GHIDRA_CAST<ANM2 *>((&this->_tearEffectANM2)))->ANM2::GetLayer(pbVar5);
blendDst = 1;
if ((uVar3 & 4) == 0) {
blendDst = 6;
}
layer->_blendMode[0] = 0;
layer->_blendMode[1] = blendDst;
layer->_blendMode[2] = 1;
layer->_blendMode[3] = 1;
layer->_blendMode[4] = 1;
}
(GHIDRA_CAST<ANM2 *>((&this->_tearEffectANM2)))->ANM2::Play(s_Idle,0);
goto LAB_00676b9b;
}
fStack_34 = 0.0;
local_30 = 2.10195e-44;
local_44[0] = '\0';
local_44[1] = '\0';
local_44[2] = '\0';
local_44[3] = '\0';
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_44)) + 0x0))) = std::_Allocate(0x20);
fStack_34 = 3.92364e-44;
local_30 = 4.34403e-44;
builtin_strncpy((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_44))) + 0x0))),"gfx/HolyLightTearEffect.anm2",0x1d);
local_14 = 3;
(GHIDRA_CAST<ANM2 *>((&this->_tearEffectANM2)))->ANM2::Load(GHIDRA_CAST<std_string *>(local_44),1);
local_14 = 0xffffffff;
if (0xf < GHIDRA_UINT(local_30)) {
uVar3 = GHIDRA_INT(local_30) + 1;
freeBlock = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_44))) + 0x0)));
if (0xfff < uVar3) {
freeBlock = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_44)) + 0x0))) + -4));
uVar3 = GHIDRA_INT(local_30) + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_44)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(freeBlock,uVar3);
}
uVar3 = g_graphicsManager_flags;
layer = (GHIDRA_CAST<ANM2 *>((&this->_tearEffectANM2)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x0));
blendDst = 1;
if ((uVar3 & 4) == 0) {
blendDst = 6;
}
layer->_blendMode[0] = 0;
layer->_blendMode[1] = blendDst;
layer->_blendMode[2] = 1;
layer->_blendMode[3] = 1;
layer->_blendMode[4] = 1;
pbVar5 = (this->_tearEffectANM2)._animState._animData;
if (pbVar5 != GHIDRA_CAST<byte *>(0x0)) {
pbVar2 = pbVar5;
if (0xf < *GHIDRA_CAST<uint *>((pbVar5 + 0x14))) {
pbVar2 = *GHIDRA_CAST<byte **>(pbVar5);
}
expectedNameCh = s_Idle;
do {
bVar1 = *pbVar2;
bVar4 = bVar1 < *expectedNameCh;
if (bVar1 != *expectedNameCh) goto LAB_006767e0;
if (bVar1 == 0) break;
bVar1 = pbVar2[1];
bVar4 = bVar1 < expectedNameCh[1];
if (bVar1 != expectedNameCh[1]) goto LAB_006767e0;
pbVar2 = pbVar2 + 2;
expectedNameCh = expectedNameCh + 2;
} while (bVar1 != 0);
LAB_006767dc:
uVar3 = 0;
goto LAB_006767e5;
}
}
else {
fStack_34 = 0.0;
local_30 = 2.10195e-44;
local_44[0] = '\0';
local_44[1] = '\0';
local_44[2] = '\0';
local_44[3] = '\0';
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_44)) + 0x0))) = std::_Allocate(0x20);
fStack_34 = 4.06377e-44;
local_30 = 4.34403e-44;
builtin_strncpy((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_44))) + 0x0))),"gfx/LittleHornTearEffect.anm2",0x1e);
local_14 = 2;
(GHIDRA_CAST<ANM2 *>((&this->_tearEffectANM2)))->ANM2::Load(GHIDRA_CAST<std_string *>(local_44),1);
local_14 = 0xffffffff;
if (0xf < GHIDRA_UINT(local_30)) {
uVar3 = GHIDRA_INT(local_30) + 1;
freeBlock = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_44))) + 0x0)));
if (0xfff < uVar3) {
freeBlock = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_44)) + 0x0))) + -4));
uVar3 = GHIDRA_INT(local_30) + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_44)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(freeBlock,uVar3);
}
layerIdx = GHIDRA_CAST<byte *>(0x0);
if ((this->_tearEffectANM2)._layerCount != 0) {
do {
uVar3 = g_graphicsManager_flags;
layer = (GHIDRA_CAST<ANM2 *>((&this->_tearEffectANM2)))->ANM2::GetLayer(layerIdx);
local_38 = 0.0;
fStack_34 = 0.0;
blendDst = 1;
layer->_blendMode[0] = 0;
if ((uVar3 & 4) == 0) {
blendDst = 6;
}
layer->_blendMode[2] = 1;
layer->_blendMode[1] = blendDst;
layer->_blendMode[3] = 1;
layer->_blendMode[4] = 1;
local_30 = 0.0;
layer = (GHIDRA_CAST<ANM2 *>((&this->_tearEffectANM2)))->ANM2::GetLayer(layerIdx);
if (&layer->_color != GHIDRA_CAST<ColorMod *>(local_58)) {
(layer->_color)._tint[0] = 1.0;
(layer->_color)._tint[1] = 0.7;
(layer->_color)._tint[2] = 0.7;
(layer->_color)._tint[3] = 1.0;
(layer->_color)._colorize[0] = 0.0;
(layer->_color)._colorize[1] = 0.0;
(layer->_color)._colorize[2] = 0.0;
(layer->_color)._colorize[3] = 0.0;
(layer->_color)._offset[0] = local_38;
(layer->_color)._offset[1] = fStack_34;
(layer->_color)._offset[2] = local_30;
}
layerIdx = layerIdx + 1;
} while (layerIdx < GHIDRA_CAST<byte *>((this->_tearEffectANM2)._layerCount));
}
pbVar5 = (this->_tearEffectANM2)._animState._animData;
if (pbVar5 != GHIDRA_CAST<byte *>(0x0)) {
pbVar2 = pbVar5;
if (0xf < *GHIDRA_CAST<uint *>((pbVar5 + 0x14))) {
pbVar2 = *GHIDRA_CAST<byte **>(pbVar5);
}
expectedNameCh = s_Idle;
do {
bVar1 = *pbVar2;
bVar4 = bVar1 < *expectedNameCh;
if (bVar1 != *expectedNameCh) goto LAB_006767e0;
if (bVar1 == 0) goto LAB_006767dc;
bVar1 = pbVar2[1];
bVar4 = bVar1 < expectedNameCh[1];
if (bVar1 != expectedNameCh[1]) goto LAB_006767e0;
pbVar2 = pbVar2 + 2;
expectedNameCh = expectedNameCh + 2;
} while (bVar1 != 0);
uVar3 = 0;
LAB_006767e5:
if ((uVar3 == 0) &&
((pbVar5[0x34] == 0 || ((this->_tearEffectANM2)._animState._isPlaying != 0))))
goto LAB_00676b9b;
}
}
bVar1 = (GHIDRA_CAST<ANM2 *>((&this->_tearEffectANM2)))->ANM2::SetAnimation(s_Idle,1);
if (bVar1 != 0) {
(GHIDRA_CAST<AnimationState *>((&(this->_tearEffectANM2)._animState)))->AnimationState::Rewind();
(this->_tearEffectANM2)._animState._isPlaying = 1;
}
LAB_00676b9b:
*GHIDRA_CAST<undefined4 *>(&(this->_tearFlags)._l) = (undefined4)flags._l;
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4)) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags._l)) + 0x4)));
*GHIDRA_CAST<undefined4 *>(&(this->_tearFlags)._h) = (undefined4)flags._h;
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4)) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags._h)) + 0x4)));
ExceptionList = local_1c;
return;
LAB_006767e0:
uVar3 = -GHIDRA_UINT(bVar4) | 1;
goto LAB_006767e5;
}
// 00676be0
void Entity_Tear::apply_death_flag_effects(Entity *target)
{
uint *puVar1;
float fVar2;
BitSet128 flags;
BitSet128 flags_00;
byte bVar3;
uint uVar4;
BitSet128 *pBVar5;
int iVar6;
BitSet128 *pBVar7;
Entity *spawned;
Entity_Tear *childTear;
EntityPtr *childScalePtr;
BitSet128 *pBVar8;
uint seed;
byte extraout_CL;
byte extraout_CL_00;
char *ptr;
float fVar9;
undefined4 uVar10;
TypeDescriptor *pTVar11;
TypeDescriptor *pTVar12;
undefined4 uVar13;
BitSet128 local_110;
BitSet128 local_100;
BitSet128 local_f0;
BitSet128 local_e0;
BitSet128 local_d0;
BitSet128 local_c0;
BitSet128 local_b0;
Vector local_a0;
Vector local_98;
BitSet128 *tearFlags;
Vector local_8c;
BitSet128 childFlags;
EntityPtr local_74;
EntityPtr local_70;
float alphaMultiplier;
Entity_Tear *local_68;
EntityPtr local_64;
Entity_Tear *local_60;
char isDeadRising;
char *spritesheetPath [2];
BitSet128 local_50;
ColorMod color;
void *local_10;
undefined1 *puStack_c;
float local_8;
float childScale;
Game *game;
Manager *manager;
local_8 = -NAN;
puStack_c = &LAB_00af79ad;
local_10 = ExceptionList;
uVar4 = __security_cookie ^ GHIDRA_UINT((&color)[1]._colorize);
ExceptionList = &local_10;
local_70 = (EntityPtr)target;
local_a0.y = (float)this;
if ((this->_dead == 0) ||
(((pBVar5 = BitSet128::operator_and(&childFlags,&this->_tearFlags,&g_tearFlagHydrobounce),
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)) ||
(isDeadRising = '\x01', 0.0 < this->_fallingSpeed || this->_fallingSpeed == 0.0)))) {
isDeadRising = '\0';
}
alphaMultiplier = 1.0;
iVar6 = __RTDynamicCast(this->_spawnerEntity,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
&IsaacRepentancePlus::Entity_Player::RTTI_Type_Descriptor,0,uVar4);
if (((iVar6 != 0) && (g_manager->_netplayManager != *GHIDRA_CAST<NetplayManager *>((g_manager + 1)))) &&
(bVar3 = NetplayManager::IsIdxLocalPlayer
(&g_manager->_netplayManager,*GHIDRA_CAST<uint *>((iVar6 + 0x1618))), bVar3 == 0)) {
if ((g_game == GHIDRA_CAST<Game *>(0x0)) || (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2)) {
alphaMultiplier = (float)(g_manager->_optionsConfig)._onlinePlayerOpacity * 0.09 + 0.1;
}
else {
alphaMultiplier = 1.0;
}
}
fVar9 = 1.0;
pBVar5 = &this->_tearFlags;
tearFlags = pBVar5;
pBVar7 = BitSet128::operator_and(&childFlags,pBVar5,&g_tearFlagSplit);
if ((((GHIDRA_INT(pBVar7->_l) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar7->_l) + 4)) != 0) ||
(GHIDRA_INT(pBVar7->_h) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar7->_h) + 4)) != 0)) &&
(fVar9 < this->_collisionDamage)) &&
((this->_height <= -5.0 && this->_height != -5.0 || (isDeadRising != '\0')))) {
local_68 = GHIDRA_CAST<Entity_Tear *>(0x0);
local_74 = (EntityPtr)0x3c23d70a;
do {
fVar9 = (this->_velocity).x;
local_8c.x = (this->_velocity).y;
local_8c.y = -fVar9;
if (local_68 == GHIDRA_CAST<Entity_Tear *>(0x1)) {
local_8c.x = -local_8c.x;
local_8c.y = fVar9;
}
uVar4 = Random();
local_98.x = (this->_pos).x - (this->_velocity).x;
local_98.y = (this->_pos).y - (this->_velocity).y;
uVar13 = 0;
pTVar12 = &IsaacRepentancePlus::Entity_Tear::RTTI_Type_Descriptor;
pTVar11 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
uVar10 = 0;
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(2,0,&local_98,&local_8c,GHIDRA_CAST<Entity *>(this->_spawnerEntity),0,uVar4);
childTear = GHIDRA_CAST<Entity_Tear *>(__RTDynamicCast(spawned,uVar10,pTVar11,pTVar12,uVar13));
local_60 = childTear;
if (isDeadRising == '\0') {
local_64 = (EntityPtr)(this->_height / 1.5);
childTear->_height = (float)local_64;
fVar9 = get_height_offset_y(childTear,(float)local_64);
game = g_game;
(childTear->_posOffset).y = fVar9;
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 8)) == 0x10) &&
((childTear->_posOffset).y = -18.0, -5.1 < (float)local_64)) {
childTear->_height = -5.1;
}
childTear->_fallingSpeed = this->_fallingSpeed;
fVar9 = this->_collisionDamage * 0.5;
}
else {
childTear->_height = -5.1;
fVar9 = get_height_offset_y(childTear,-5.1);
game = g_game;
(childTear->_posOffset).y = fVar9;
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 8)) == 0x10) {
(childTear->_posOffset).y = -18.0;
}
childTear->_fallingSpeed = this->_fallingSpeed;
childTear->_fallingAccel = 2.0;
fVar9 = this->_collisionDamage * 0.25;
}
childTear->SetCollisionDamage(fVar9);
local_64 = (EntityPtr)(this->_fScale * 0.5);
childScalePtr = &local_64;
if ((float)local_64 <= 0.01) {
childScalePtr = &local_74;
}
childScale = *GHIDRA_CAST<float *>(childScalePtr);
childTear->_baseScale = childScale;
childTear->_fScale = childScale;
ResetSpriteScale(childTear);
local_64 = (EntityPtr)(GHIDRA_CAST<BitSet128 *>((&g_tearFlagFetus)))->BitSet128::__bnot(&local_110);
pBVar5 = (GHIDRA_CAST<BitSet128 *>((&g_tearFlagHydrobounce)))->BitSet128::__bnot(&local_50);
pBVar7 = (GHIDRA_CAST<BitSet128 *>((&g_tearFlagAbsorb)))->BitSet128::__bnot(&local_c0);
pBVar8 = (GHIDRA_CAST<BitSet128 *>((&g_tearFlagLudovico)))->BitSet128::__bnot(&local_d0);
pBVar8 = BitSet128::operator_and(&local_e0,tearFlags,pBVar8);
pBVar7 = BitSet128::operator_and(&local_f0,pBVar8,pBVar7);
pBVar5 = BitSet128::operator_and(&local_100,pBVar7,pBVar5);
BitSet128::operator_and(&childFlags,pBVar5,GHIDRA_CAST<BitSet128 *>(local_64));
if (isDeadRising != '\0') {
pBVar5 = (GHIDRA_CAST<BitSet128 *>((&g_tearFlagExplosive)))->BitSet128::__bnot(&local_b0);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(childFlags._l)) + 0x0))) = GHIDRA_UINT(childFlags._l) & GHIDRA_UINT(pBVar5->_l);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(childFlags._l)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(childFlags._l)) + 0x4))) & *GHIDRA_CAST<uint *>((GHIDRA_INT(&pBVar5->_l) + 4));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(childFlags._h)) + 0x0))) = GHIDRA_UINT(childFlags._h) & GHIDRA_UINT(pBVar5->_h);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(childFlags._h)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(childFlags._h)) + 0x4))) & *GHIDRA_CAST<uint *>((GHIDRA_INT(&pBVar5->_h) + 4));
}
childTear = local_60;
this = GHIDRA_CAST<Entity_Tear *>(local_a0.y);
color._tint[0] = ((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_a0.y) + 0x48)))->_color)._tint[0];
color._tint[1] = ((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_a0.y) + 0x48)))->_color)._tint[1];
color._tint[2] = ((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_a0.y) + 0x48)))->_color)._tint[2];
color._offset[2] = ((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_a0.y) + 0x48)))->_color)._offset[2];
color._colorize[0] = ((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_a0.y) + 0x48)))->_color)._colorize[0];
color._colorize[1] = ((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_a0.y) + 0x48)))->_color)._colorize[1];
color._colorize[2] = ((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_a0.y) + 0x48)))->_color)._colorize[2];
color._colorize[3] = ((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_a0.y) + 0x48)))->_color)._colorize[3];
color._tint[3] = ((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_a0.y) + 0x48)))->_color)._tint[3] * alphaMultiplier;
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(color._offset)) + 0x0))) = *GHIDRA_CAST<undefined8 *>(((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_a0.y) + 0x48)))->_color)._offset);
local_60->SetColor(&color,0xffffffff,0xff,0,1);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags._l)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(childFlags._l)) + 0x4)));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags._l)) + 0x0))) = GHIDRA_UINT(childFlags._l);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags._h)) + 0x0))) = GHIDRA_UINT(childFlags._h);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags._h)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(childFlags._h)) + 0x4)));
SetTearFlags(childTear,flags);
local_64 = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x3bc));
if (childTear->_parent != (EntityPtr)0x0) {
local_60 = GHIDRA_CAST<Entity_Tear *>(&childTear->_parent);
std::multiset<unsigned_int>::erase(&local_60);
}
childTear->_parent = local_64;
if (local_64 != (EntityPtr)0x0) {
std::multiset<unsigned_int>::insert(&childTear->_parent);
}
childTear->Update();
local_68 = GHIDRA_CAST<Entity_Tear *>((GHIDRA_INT(local_68) + 1));
} while (GHIDRA_INT(local_68) < 2);
pBVar5 = GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(this) + 0x428));
}
fVar9 = -5.0;
pBVar7 = BitSet128::operator_and(&local_b0,pBVar5,&g_tearFlagBone);
if (((GHIDRA_INT(pBVar7->_l) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar7->_l) + 4)) != 0) ||
(GHIDRA_INT(pBVar7->_h) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar7->_h) + 4)) != 0)) &&
(this->_height <= fVar9 && fVar9 != this->_height)) {
local_64 = (EntityPtr)0x0;
do {
uVar4 = Random();
fVar9 = (float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
2.3283064e-10 * 3.14;
local_60 = GHIDRA_CAST<Entity_Tear *>((fVar9 + fVar9));
local_68 = GHIDRA_CAST<Entity_Tear *>(sin((float)local_60));
fVar9 = (this->_velocity).y;
fVar2 = (this->_velocity).x;
local_74 = (EntityPtr)sqrtf(fVar2 * fVar2 + fVar9 * fVar9);
local_98.x = cos((float)local_60);
local_98.x = local_98.x * (float)local_74;
uVar4 = this->_variant;
local_98.y = (float)local_68 * (float)local_74;
if (uVar4 == 0x32) {
uVar4 = 0x1d;
}
seed = Random();
local_8c.x = (this->_pos).x - (this->_velocity).x;
local_8c.y = (this->_pos).y - (this->_velocity).y;
uVar13 = 0;
pTVar12 = &IsaacRepentancePlus::Entity_Tear::RTTI_Type_Descriptor;
pTVar11 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
uVar10 = 0;
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(2,uVar4,&local_8c,&local_98,GHIDRA_CAST<Entity *>(this->_spawnerEntity),0,seed);
childTear = GHIDRA_CAST<Entity_Tear *>(__RTDynamicCast(spawned,uVar10,pTVar11,pTVar12,uVar13));
local_68 = childTear;
if (uVar4 == 0x1d) {
spritesheetPath[0] = std::_Allocate(0x20);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50._h)) + 0x0))) = 0x18;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50._h)) + 0x4))) = 0x1f;
builtin_strncpy(spritesheetPath[0],"gfx/tears_brokenbone.png",0x19);
local_8 = 0.0;
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&childTear->_sprite))))->Sprite::ReplaceSpritesheet(0,GHIDRA_CAST<std_string *>(spritesheetPath));
local_8 = -NAN;
bVar3 = extraout_CL;
if (0xf < (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50._h)) + 0x4)))) {
uVar4 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50._h)) + 0x4))) + 1;
ptr = spritesheetPath[0];
if (0xfff < uVar4) {
ptr = *GHIDRA_CAST<char **>((spritesheetPath[0] + -4));
uVar4 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_50._h)) + 0x4))) + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < spritesheetPath[0] + (-4 - GHIDRA_INT(ptr))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(ptr,uVar4);
bVar3 = extraout_CL_00;
}
(GHIDRA_CAST<ANM2 *>((&childTear->_sprite)))->ANM2::LoadGraphics(bVar3);
}
local_60 = GHIDRA_CAST<Entity_Tear *>(this->_height);
childTear->_height = (float)local_60;
fVar9 = get_height_offset_y(childTear,(float)local_60);
game = g_game;
(childTear->_posOffset).y = fVar9;
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 8)) == 0x10) &&
((childTear->_posOffset).y = -18.0, -5.1 < (float)local_60)) {
childTear->_height = -5.1;
}
childTear->_fallingSpeed = this->_fallingSpeed;
childTear->SetCollisionDamage(this->_collisionDamage * 0.5);
pBVar5 = (GHIDRA_CAST<BitSet128 *>((&g_tearFlagFetus)))->BitSet128::__bnot(&local_b0);
pBVar7 = (GHIDRA_CAST<BitSet128 *>((&g_tearFlagBone)))->BitSet128::__bnot(&local_100);
pBVar8 = (GHIDRA_CAST<BitSet128 *>((&g_tearFlagLudovico)))->BitSet128::__bnot(&local_f0);
pBVar8 = BitSet128::operator_and(&local_e0,tearFlags,pBVar8);
pBVar7 = BitSet128::operator_and(&local_d0,pBVar8,pBVar7);
BitSet128::operator_and(&childFlags,pBVar7,pBVar5);
if (isDeadRising != '\0') {
pBVar5 = (GHIDRA_CAST<BitSet128 *>((&g_tearFlagExplosive)))->BitSet128::__bnot(&local_c0);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(childFlags._l)) + 0x0))) = GHIDRA_UINT(childFlags._l) & GHIDRA_UINT(pBVar5->_l);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(childFlags._l)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(childFlags._l)) + 0x4))) & *GHIDRA_CAST<uint *>((GHIDRA_INT(&pBVar5->_l) + 4));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(childFlags._h)) + 0x0))) = GHIDRA_UINT(childFlags._h) & GHIDRA_UINT(pBVar5->_h);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(childFlags._h)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(childFlags._h)) + 0x4))) & *GHIDRA_CAST<uint *>((GHIDRA_INT(&pBVar5->_h) + 4));
}
childTear = local_68;
this = GHIDRA_CAST<Entity_Tear *>(local_a0.y);
color._tint[0] = ((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_a0.y) + 0x48)))->_color)._tint[0];
color._tint[1] = ((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_a0.y) + 0x48)))->_color)._tint[1];
color._tint[2] = ((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_a0.y) + 0x48)))->_color)._tint[2];
color._offset[2] = ((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_a0.y) + 0x48)))->_color)._offset[2];
color._colorize[0] = ((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_a0.y) + 0x48)))->_color)._colorize[0];
color._colorize[1] = ((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_a0.y) + 0x48)))->_color)._colorize[1];
color._colorize[2] = ((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_a0.y) + 0x48)))->_color)._colorize[2];
color._colorize[3] = ((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_a0.y) + 0x48)))->_color)._colorize[3];
color._tint[3] = ((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_a0.y) + 0x48)))->_color)._tint[3] * alphaMultiplier;
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(color._offset)) + 0x0))) = *GHIDRA_CAST<undefined8 *>(((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_a0.y) + 0x48)))->_color)._offset);
local_68->SetColor(&color,0xffffffff,0xff,0,1);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags_00._l)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(childFlags._l)) + 0x4)));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags_00._l)) + 0x0))) = GHIDRA_UINT(childFlags._l);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags_00._h)) + 0x0))) = GHIDRA_UINT(childFlags._h);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags_00._h)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(childFlags._h)) + 0x4)));
SetTearFlags(childTear,flags_00);
local_74 = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(this) + 0x3bc));
if (childTear->_parent != (EntityPtr)0x0) {
local_60 = GHIDRA_CAST<Entity_Tear *>(&childTear->_parent);
std::multiset<unsigned_int>::erase(&local_60);
}
childTear->_parent = local_74;
if (local_74 != (EntityPtr)0x0) {
std::multiset<unsigned_int>::insert(&childTear->_parent);
}
childTear->Update();
local_64 = (EntityPtr)(GHIDRA_INT(local_64) + 1);
} while (GHIDRA_INT(local_64) < 2);
pBVar5 = GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(this) + 0x428));
}
pBVar7 = BitSet128::operator_and(&local_b0,pBVar5,&g_tearFlagJacobs);
if (((GHIDRA_INT(pBVar7->_l) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar7->_l) + 4)) != 0) ||
(GHIDRA_INT(pBVar7->_h) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar7->_h) + 4)) != 0)) &&
(this->_height <= -5.0 && this->_height != -5.0)) {
spawned = spawn_chain_lightning
(&this->_pos,*pBVar5,GHIDRA_CAST<Entity *>(this->_spawnerEntity),
this->_collisionDamage * 0.5);
if (local_70 != (EntityPtr)0x0) {
if (spawned->_target != (EntityPtr)0x0) {
local_60 = GHIDRA_CAST<Entity_Tear *>(&spawned->_target);
std::multiset<unsigned_int>::erase(&local_60);
}
spawned->_target = local_70;
std::multiset<unsigned_int>::insert(&spawned->_target);
}
color._tint[0] = (spawned->_sprite)._color._tint[0];
color._tint[1] = (spawned->_sprite)._color._tint[1];
color._tint[2] = (spawned->_sprite)._color._tint[2];
color._colorize[0] = (spawned->_sprite)._color._colorize[0];
color._colorize[1] = (spawned->_sprite)._color._colorize[1];
color._colorize[2] = (spawned->_sprite)._color._colorize[2];
color._colorize[3] = (spawned->_sprite)._color._colorize[3];
color._tint[3] = (spawned->_sprite)._color._tint[3] * alphaMultiplier;
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(color._offset)) + 0x0))) = *GHIDRA_CAST<undefined8 *>((spawned->_sprite)._color._offset);
color._offset[2] = (spawned->_sprite)._color._offset[2];
spawned->SetColor(&color,0xffffffff,0xff,0,1);
spawned->Update();
pBVar5 = &this->_tearFlags;
}
pBVar7 = BitSet128::operator_and(&local_b0,pBVar5,&g_tearFlagRift);
if ((GHIDRA_INT(pBVar7->_l) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar7->_l) + 4)) != 0) ||
(GHIDRA_INT(pBVar7->_h) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&pBVar7->_h) + 4)) != 0)) {
pBVar7 = (GHIDRA_CAST<BitSet128 *>((&g_tearFlagRift)))->BitSet128::__bnot(&local_b0);
*GHIDRA_CAST<uint *>(&pBVar5->_l) = GHIDRA_UINT(pBVar5->_l) & GHIDRA_UINT(pBVar7->_l);
puVar1 = GHIDRA_CAST<uint *>((GHIDRA_INT(&pBVar5->_l) + 4));
*puVar1 = *puVar1 & *GHIDRA_CAST<uint *>((GHIDRA_INT(&pBVar7->_l) + 4));
*GHIDRA_CAST<uint *>(&pBVar5->_h) = GHIDRA_UINT(pBVar5->_h) & GHIDRA_UINT(pBVar7->_h);
puVar1 = GHIDRA_CAST<uint *>((GHIDRA_INT(&pBVar5->_h) + 4));
*puVar1 = *puVar1 & *GHIDRA_CAST<uint *>((GHIDRA_INT(&pBVar7->_h) + 4));
game = g_game;
bVar3 = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::IsPositionInRoom(&this->_pos,-10.0);
if (bVar3 != 0) {
local_60 = GHIDRA_CAST<Entity_Tear *>((this->_collisionDamage * 0.5));
Room::GetClampedPositionImpl(game->_room,&local_a0,&this->_pos,0.0,0.0,0.0,0.0);
uVar4 = Random();
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xb4,&local_a0,&g_vectorZero,GHIDRA_CAST<Entity *>(this->_spawnerEntity),
0,uVar4);
fVar9 = this->_fScale * g_vectorOne.x;
iVar6 = *GHIDRA_CAST<int *>(spawned);
(spawned->_sprite)._scale.y = this->_fScale * g_vectorOne.y;
(spawned->_sprite)._scale.x = fVar9;
(**(code **)(iVar6 + 0x40))(local_60);
uVar10 = 0x3c;
iVar6 = *GHIDRA_CAST<int *>(spawned);
if (1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) {
uVar10 = 0x1e;
}
*GHIDRA_CAST<undefined4 *>((spawned[1]._sprite._filename._buf + 4)) = uVar10;
*GHIDRA_CAST<undefined4 *>((spawned[1]._sprite._filename._buf + 8)) = uVar10;
(**(code **)(iVar6 + 0xc))();
manager = g_manager;
local_70 = (EntityPtr)0x440;
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_70));
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_70),0.5,2,0,1.0,0.0);
}
}
ExceptionList = local_10;
return;
}
// 00677780
void Entity_Tear::ResetSpriteScale()
{
float *scaleThreshold;
uint startFrame;
void *animData;
int iVar1;
LayerState *layer;
char *format;
int scaleAnimBase;
byte *layerIndex;
uint uVar2;
float fVar3;
float fVar4;
float fVar5;
float local_4c;
float local_48;
float sizeMultiX;
float local_40;
float layerSizeY;
undefined1 local_38 [8];
void *seedEffectNode;
byte animName [32];
uint local_c;
Game *game;
local_c = __security_cookie ^ GHIDRA_UINT(&local_4c);
local_4c = 1.0;
iVar1 = this->_variant;
scaleAnimBase = iVar1 * 100;
local_48 = (float)scaleAnimBase;
switch(iVar1) {
case 0:
case 1:
case 2:
case 3:
case 10:
case 0xb:
case 0xc:
case 0xd:
case 0xe:
case 0xf:
case 0x10:
case 0x11:
case 0x12:
case 0x13:
case 0x14:
case 0x15:
case 0x16:
case 0x17:
case 0x18:
case 0x19:
case 0x1a:
case 0x1b:
case 0x1c:
case 0x1d:
case 0x1e:
case 0x1f:
case 0x20:
case 0x21:
case 0x22:
case 0x23:
case 0x24:
case 0x25:
case 0x26:
case 0x27:
case 0x29:
case 0x30:
uVar2 = 1;
scaleThreshold = GHIDRA_CAST<float *>(&DAT_00b64e30);
do {
if (this->_fScale <= *scaleThreshold + 0.05) break;
uVar2 = uVar2 + 1;
scaleThreshold = scaleThreshold + 1;
} while (uVar2 < 0xd);
if (this->_scaleAnimNum != scaleAnimBase + uVar2) {
if (((((iVar1 == 1) || (iVar1 == 0xc)) || (iVar1 == 0xf)) ||
((iVar1 == 0x11 || (iVar1 == 0x22)))) || (iVar1 == 0x19)) {
format = "BloodTear%d";
}
else if ((iVar1 == 2) || (iVar1 == 0x1e)) {
format = "Tooth%dMove";
}
else if (iVar1 == 0x14) {
format = "Rotate%d";
}
else if ((((iVar1 == 0x16) || (iVar1 == 0x1a)) || (iVar1 == 0x1b)) ||
(((iVar1 == 0x1c || (iVar1 == 0x1d)) || (iVar1 == 0x30)))) {
format = "Stone%dMove";
}
else {
format = "RegularTear%d";
}
sprintf_s(animName,0x20,GHIDRA_CAST<byte *>(format));
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(animName,0);
this->_scaleAnimNum = scaleAnimBase + uVar2;
}
if (GHIDRA_INT(uVar2) < 0xd) {
if ((((GHIDRA_UINT(g_tearFlagGrow._l) | GHIDRA_UINT(g_tearFlagLudovico._l)) & GHIDRA_UINT((this->_tearFlags)._l))
== 0 && (((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagGrow._l)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagLudovico._l)) + 0x4)))) &
*GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4))) == 0) &&
(((GHIDRA_UINT(g_tearFlagGrow._h) | GHIDRA_UINT(g_tearFlagLudovico._h)) & GHIDRA_UINT((this->_tearFlags)._h)) ==
0 && (*GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4)) &
((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagGrow._h)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagLudovico._h)) + 0x4))))) == 0)) {
local_4c = 1.0;
fVar3 = 1.0;
}
else {
local_4c = this->_fScale / *GHIDRA_CAST<float *>((&DAT_00b64e2c + uVar2 * 4));
fVar3 = local_4c;
}
}
else {
local_4c = this->_fScale / 2.75;
fVar3 = local_4c;
}
break;
default:
if (this->_scaleAnimNum != scaleAnimBase) {
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(s_Idle,0);
this->_scaleAnimNum = scaleAnimBase;
}
case 0x28:
switchD_006777c1_caseD_28:
fVar3 = 1.0;
break;
case 5:
case 6:
case 7:
if (this->_scaleAnimNum != scaleAnimBase) {
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<byte *>("MoveHori"),0);
this->_scaleAnimNum = scaleAnimBase;
}
local_4c = this->_fScale / 2.75;
fVar3 = (this->_velocity).x + 0.0;
fVar4 = this->_fallingSpeed + (this->_velocity).y;
if (0 < this->_waitFrames) {
fVar3 = (this->_continueVelocity).x;
fVar4 = (this->_continueVelocity).y;
}
fVar3 = atan2f(fVar4,fVar3);
(this->_sprite)._rotation = fVar3 * 57.295776;
fVar3 = local_4c;
break;
case 8:
case 0x2a:
local_4c = this->_fScale;
iVar1 = 0;
do {
if (local_4c <= (float)(&DAT_00b64e90)[iVar1]) break;
iVar1 = iVar1 + 1;
} while (iVar1 < 5);
sprintf(animName,GHIDRA_CAST<byte *>("Rotate%d"));
if (((this->_sprite)._animState._animData == (void *)0x0) ||
((this->_sprite)._animState._isPlaying == 0)) {
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(animName,0);
animData = (this->_sprite)._animState._animData;
if ((animData == (void *)0x0) || (uVar2 = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(animData) + 0x30)), uVar2 == 0)) {
startFrame = 0;
}
else {
startFrame = Random();
startFrame = startFrame % uVar2;
animData = (this->_sprite)._animState._animData;
}
if (animData != (void *)0x0) {
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat((float)GHIDRA_INT(startFrame));
}
}
else {
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(animName,0);
}
fVar3 = local_4c;
if (this->_variant == 8) {
this->_fScale = this->_fScale + this->_fScale;
}
break;
case 9:
if (this->_dead == 0) {
if (this->_scaleAnimNum != scaleAnimBase) {
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<byte *>("Rotate"),0);
this->_scaleAnimNum = scaleAnimBase;
}
(this->_sprite)._flipX = (this->_velocity).x <= 0.0 && (this->_velocity).x != 0.0;
}
goto switchD_006777c1_caseD_28;
case 0x2e:
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<byte *>("Flickering"),0);
uVar2 = g_graphicsManager_flags;
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x0));
iVar1 = 1;
if ((uVar2 & 4) == 0) {
iVar1 = 6;
}
layer->_blendMode[0] = 0;
layer->_blendMode[1] = iVar1;
layer->_blendMode[2] = 1;
layer->_blendMode[3] = 1;
layer->_blendMode[4] = 1;
goto switchD_006777c1_caseD_28;
case 0x2f:
case 0x31:
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(s_Idle,0);
local_4c = this->_fScale;
fVar3 = local_4c;
break;
case 0x32:
uVar2 = 0;
fVar3 = this->_fScale + 0.25;
this->_fScale = fVar3;
do {
if (fVar3 <= (float)(&DAT_00b64e70)[uVar2]) break;
uVar2 = uVar2 + 1;
} while (GHIDRA_INT(uVar2) < 4);
if (this->_scaleAnimNum != uVar2 + scaleAnimBase) {
this->_scaleAnimNum = uVar2 + scaleAnimBase;
sprintf(animName,GHIDRA_CAST<byte *>("Rotate%d"));
if (this->_scaleAnimNum / 100 == GHIDRA_INT(local_48) / 100) {
iVar1 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetFrame();
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(animName,0);
if (iVar1 < 0) goto LAB_00677c46;
}
else {
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(animName,0);
LAB_00677c46:
animData = (this->_sprite)._animState._animData;
if (animData == (void *)0x0) {
iVar1 = 0;
}
else {
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animData) + 0x30));
}
iVar1 = Isaac::Random(iVar1);
}
if (((this->_sprite)._animState._animData != (void *)0x0) &&
((GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat((float)iVar1),
(this->_sprite)._animState._animData != (void *)0x0)) {
(this->_sprite)._animState._isPlaying = 0;
}
}
if (uVar2 < 5) {
local_4c = this->_fScale / (float)(&DAT_00b64e70)[uVar2];
fVar3 = local_4c;
}
else {
local_4c = this->_fScale / 2.25;
fVar3 = local_4c;
}
}
game = g_game;
fVar4 = (this->_sizeMulti).x;
fVar5 = (this->_sizeMulti).y;
uVar2 = this->_variant;
local_48 = fVar5;
sizeMultiX = fVar4;
if (uVar2 < 0x33) {
if ((uVar2 == 0xd) || (uVar2 == 0x17)) {
local_40 = 1.10703e-43;
std::set<int>::find_node(local_38,&local_40);
if ((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(seedEffectNode) + 0xd)) == '\0') &&
((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(seedEffectNode) + 0x10)) < 0x50 &&
(seedEffectNode != (game->_seedEffects)._seedEffects)))) {
fVar4 = fVar4 / 3.0;
sizeMultiX = fVar4;
}
}
layerIndex = GHIDRA_CAST<byte *>(0x0);
if ((this->_sprite)._layerCount != 0) {
do {
local_40 = fVar3 * g_vectorOne.x * fVar4;
layerSizeY = fVar3 * g_vectorOne.y * fVar5;
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(layerIndex);
layerIndex = layerIndex + 1;
(layer->_size).x = local_40;
(layer->_size).y = layerSizeY;
fVar4 = sizeMultiX;
fVar5 = local_48;
fVar3 = local_4c;
} while (layerIndex < GHIDRA_CAST<byte *>((this->_sprite)._layerCount));
}
}
else {
layerIndex = GHIDRA_CAST<byte *>(0x0);
if ((this->_sprite)._layerCount != 0) {
do {
local_40 = this->_fScale * g_vectorOne.y * local_48;
local_4c = this->_fScale * g_vectorOne.x * sizeMultiX;
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(layerIndex);
layerIndex = layerIndex + 1;
(layer->_size).x = local_4c;
(layer->_size).y = local_40;
fVar4 = sizeMultiX;
fVar5 = local_48;
} while (layerIndex < GHIDRA_CAST<byte *>((this->_sprite)._layerCount));
}
}
if (((GHIDRA_UINT((this->_tearFlags)._l) & GHIDRA_UINT(g_tearFlagGlow._l)) != 0 ||
(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagGlow._l)) + 0x4)))) != 0) ||
((GHIDRA_UINT((this->_tearFlags)._h) & GHIDRA_UINT(g_tearFlagGlow._h)) != 0 ||
(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagGlow._h)) + 0x4)))) != 0)) {
fVar3 = this->_fScale * 0.45;
(this->_tearHaloANM2)._scale.y = fVar3 * fVar5;
(this->_tearHaloANM2)._scale.x = fVar3 * fVar4;
if ((this->_tearHaloANM2)._loaded != 0) {
(GHIDRA_CAST<AnimationState *>((&(this->_tearHaloANM2)._animState)))->AnimationState::Update();
(GHIDRA_CAST<AnimationState *>((&(this->_tearHaloANM2)._overlayAnimState)))->AnimationState::Update();
}
}
if ((this->_tearEffectANM2)._loaded != 0) {
fVar3 = this->_fScale * 0.45;
(this->_tearEffectANM2)._scale.y = fVar3 * local_48;
(this->_tearEffectANM2)._scale.x = fVar3 * sizeMultiX;
(GHIDRA_CAST<AnimationState *>((&(this->_tearEffectANM2)._animState)))->AnimationState::Update();
(GHIDRA_CAST<AnimationState *>((&(this->_tearEffectANM2)._overlayAnimState)))->AnimationState::Update();
}
if (this->_deadEyeIntensity != 0.0) {
fVar3 = this->_fScale * 0.45;
(this->_deadEyeANM2)._scale.y = fVar3 * local_48;
(this->_deadEyeANM2)._scale.x = fVar3 * sizeMultiX;
if ((this->_deadEyeANM2)._loaded != 0) {
(GHIDRA_CAST<AnimationState *>((&(this->_deadEyeANM2)._animState)))->AnimationState::Update();
(GHIDRA_CAST<AnimationState *>((&(this->_deadEyeANM2)._overlayAnimState)))->AnimationState::Update();
}
}
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::SetSize(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_config) + 0x38)) * this->_fScale,
this->_sizeMulti,*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_config) + 0x48)));
this->_shadowSize =
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_config) + 0x24)) * this->_fScale * (sizeMultiX + local_48) * 0.5;
return;
}
// 00678060
byte Entity_Tear::is_not_familiar_spawned()
{
if ((this->_parent == (EntityPtr)0x0) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_parent) + 0x28)) != 2)) {
return 1;
}
return 0;
}
// 00678080
void Entity_Tear::fire_split_projectiles(byte isHalved)
{
uint *puVar1;
double dVar2;
EntityPtr EVar3;
code *pcVar4;
BitSet128 flags;
qword qVar5;
byte isOwned;
uint uVar6;
Entity_Tear *childShot;
Entity_Bomb *childBomb;
uint uVar7;
Entity_Laser *techXLaser;
Entity *spawned;
uint uVar8;
int iVar9;
uint uVar10;
uint uVar11;
float fVar12;
float fVar13;
float fVar14;
Entity_Player *player;
uint splitCount;
float shotSpeed;
Vector bombVelocity;
Vector bombPos;
Vector techXVelocity;
Vector laserDirection;
Vector tearVelocity;
uint uStack_20;
uint uStack_1c;
uint uStack_18;
uint uStack_14;
Game *game;
player = GHIDRA_CAST<Entity_Player *>(0x0);
EVar3 = this->_parent;
if (EVar3 == (EntityPtr)0x0) {
LAB_006780c0:
splitCount = 6;
if (player == GHIDRA_CAST<Entity_Player *>(0x0)) goto LAB_00678128;
}
else {
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar3) + 0x28)) != 1) {
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar3) + 0x28)) == 3) {
player = *GHIDRA_CAST<Entity_Player **>((GHIDRA_CAST<char *>(EVar3) + 0x410));
}
goto LAB_006780c0;
}
player = GHIDRA_CAST<Entity_Player *>(EVar3);
}
isOwned = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0xe5,0);
if ((isOwned == 0) && (isOwned = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0x18b,0), isOwned == 0)) {
isOwned = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0x76,0);
if (isOwned != 0) {
splitCount = 4;
goto LAB_00678128;
}
splitCount = 6;
isOwned = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0x34,0);
if (isOwned == 0) goto LAB_00678128;
}
splitCount = 3;
LAB_00678128:
uVar6 = Random();
splitCount = splitCount + uVar6 % splitCount;
if (isHalved != 0) {
splitCount = (splitCount + 1) / 2;
}
shotSpeed = 1.0;
if (player != GHIDRA_CAST<Entity_Player *>(0x0)) {
shotSpeed = player->_shotspeed;
}
if (splitCount != 0) {
do {
if (player == GHIDRA_CAST<Entity_Player *>(0x0)) {
LAB_00678885:
uVar6 = Random();
EVar3 = this->_spawnerEntity;
uVar7 = Random();
fVar12 = (float)((double)GHIDRA_INT(uVar7) + __uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) *
2.3283064e-10 * 360.0 * 0.017453292;
fVar13 = cos(fVar12);
fVar12 = sin(fVar12);
tearVelocity.x = fVar13 * shotSpeed * 10.0 - fVar12 * 0.0;
tearVelocity.y = fVar12 * shotSpeed * 10.0 + fVar13 * 0.0;
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(2,1,&this->_pos,&tearVelocity,GHIDRA_CAST<Entity *>(EVar3),0,uVar6,0);
childShot = (Entity_Tear *)
__RTDynamicCast(spawned,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
&IsaacRepentancePlus::Entity_Tear::RTTI_Type_Descriptor,0);
if ((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(ThreadLocalStoragePointer) + 0xc)) < DAT_00c80008) &&
(_Init_thread_header(&DAT_00c80008), DAT_00c80008 == -1)) {
DAT_00c80010 = GHIDRA_UINT(g_tearFlagSpore._l) | GHIDRA_UINT(g_tearFlagOccult._l) |
GHIDRA_UINT(g_tearFlagBait._l) | GHIDRA_UINT(g_tearFlagMagnetize._l) |
GHIDRA_UINT(g_tearFlagIce._l) | GHIDRA_UINT(g_tearFlagPunch._l) |
GHIDRA_UINT(g_tearFlagCreepTrail._l) | GHIDRA_UINT(g_tearFlagHydrobounce._l) |
GHIDRA_UINT(g_tearFlagLasershot._l) | GHIDRA_UINT(g_tearFlagLaser._l) |
GHIDRA_UINT(g_tearFlagHorn._l) | GHIDRA_UINT(g_tearFlagJacobs._l) |
GHIDRA_UINT(g_tearFlagNeedle._l) | GHIDRA_UINT(g_tearFlagMidas._l) |
GHIDRA_UINT(g_tearFlagBelial._l) | GHIDRA_UINT(g_tearFlagAcid._l) |
GHIDRA_UINT(g_tearFlagEgg._l) | GHIDRA_UINT(g_tearFlagBooger._l) |
GHIDRA_UINT(g_tearFlagPermanentConfusion._l) | GHIDRA_UINT(g_tearFlagBigSpiral._l) |
GHIDRA_UINT(g_tearFlagGreedCoin._l) | GHIDRA_UINT(g_tearFlagGodsFlesh._l) |
GHIDRA_UINT(g_tearFlagBlackHpDrop._l) | GHIDRA_UINT(g_tearFlagCoinDrop._l) |
GHIDRA_UINT(g_tearFlagLightFromHeaven._l) | GHIDRA_UINT(g_tearFlagContinuum._l) |
GHIDRA_UINT(g_tearFlagSticky._l) | GHIDRA_UINT(g_tearFlagMysteriousLiquidCreep._l) |
GHIDRA_UINT(g_tearFlagGish._l) | GHIDRA_UINT(g_tearFlagGlow._l) |
GHIDRA_UINT(g_tearFlagSquare._l) | GHIDRA_UINT(g_tearFlagFlat._l) |
GHIDRA_UINT(g_tearFlagSpiral._l) | GHIDRA_UINT(g_tearFlagPulse._l) |
GHIDRA_UINT(g_tearFlagKnockback._l) | GHIDRA_UINT(g_tearFlagAttractor._l) |
GHIDRA_UINT(g_tearFlagBurn._l) | GHIDRA_UINT(g_tearFlagShrink._l) |
GHIDRA_UINT(g_tearFlagFear._l) | GHIDRA_UINT(g_tearFlagBounce._l) |
GHIDRA_UINT(g_tearFlagHpDrop._l) | GHIDRA_UINT(g_tearFlagConfusion._l) |
GHIDRA_UINT(g_tearFlagCharm._l) | GHIDRA_UINT(g_tearFlagMulligan._l) |
GHIDRA_UINT(g_tearFlagWiggle._l) | GHIDRA_UINT(g_tearFlagPersistent._l) |
GHIDRA_UINT(g_tearFlagGrow._l) | GHIDRA_UINT(g_tearFlagFreeze._l) |
GHIDRA_UINT(g_tearFlagPoison._l) | GHIDRA_UINT(g_tearFlagSlow._l) |
GHIDRA_UINT(g_tearFlagHoming._l) | GHIDRA_UINT(g_tearFlagSpectral._l) |
GHIDRA_UINT(g_tearFlagPiercing._l);
DAT_00c80014 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagSpore._l)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagOccult._l)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagBait._l)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagMagnetize._l)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagIce._l)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagPunch._l)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagCreepTrail._l)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagHydrobounce._l)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagLasershot._l)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagLaser._l)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagHorn._l)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagJacobs._l)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagNeedle._l)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagMidas._l)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagBelial._l)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagAcid._l)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagEgg._l)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagBooger._l)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagPermanentConfusion._l)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagBigSpiral._l)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagGreedCoin._l)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagGodsFlesh._l)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagBlackHpDrop._l)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagCoinDrop._l)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagLightFromHeaven._l)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagContinuum._l)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagSticky._l)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagMysteriousLiquidCreep._l)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagGish._l)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagGlow._l)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagSquare._l)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagFlat._l)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagSpiral._l)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagPulse._l)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagKnockback._l)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagAttractor._l)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagBurn._l)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagShrink._l)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagFear._l)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagBounce._l)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagHpDrop._l)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagConfusion._l)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagCharm._l)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagMulligan._l)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagWiggle._l)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagPersistent._l)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagGrow._l)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagFreeze._l)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagPoison._l)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagSlow._l)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagHoming._l)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagSpectral._l)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagPiercing._l)) + 0x4)));
DAT_00c80018 = GHIDRA_UINT(g_tearFlagSpore._h) | GHIDRA_UINT(g_tearFlagOccult._h) |
GHIDRA_UINT(g_tearFlagBait._h) | GHIDRA_UINT(g_tearFlagMagnetize._h) |
GHIDRA_UINT(g_tearFlagIce._h) | GHIDRA_UINT(g_tearFlagPunch._h) |
GHIDRA_UINT(g_tearFlagCreepTrail._h) | GHIDRA_UINT(g_tearFlagHydrobounce._h) |
GHIDRA_UINT(g_tearFlagLasershot._h) | GHIDRA_UINT(g_tearFlagLaser._h) |
GHIDRA_UINT(g_tearFlagHorn._h) | GHIDRA_UINT(g_tearFlagJacobs._h) |
GHIDRA_UINT(g_tearFlagNeedle._h) | GHIDRA_UINT(g_tearFlagMidas._h) |
GHIDRA_UINT(g_tearFlagBelial._h) | GHIDRA_UINT(g_tearFlagAcid._h) |
GHIDRA_UINT(g_tearFlagEgg._h) | GHIDRA_UINT(g_tearFlagBooger._h) |
GHIDRA_UINT(g_tearFlagPermanentConfusion._h) | GHIDRA_UINT(g_tearFlagBigSpiral._h) |
GHIDRA_UINT(g_tearFlagGreedCoin._h) | GHIDRA_UINT(g_tearFlagGodsFlesh._h) |
GHIDRA_UINT(g_tearFlagBlackHpDrop._h) | GHIDRA_UINT(g_tearFlagCoinDrop._h) |
GHIDRA_UINT(g_tearFlagLightFromHeaven._h) | GHIDRA_UINT(g_tearFlagContinuum._h) |
GHIDRA_UINT(g_tearFlagSticky._h) | GHIDRA_UINT(g_tearFlagMysteriousLiquidCreep._h) |
GHIDRA_UINT(g_tearFlagGish._h) | GHIDRA_UINT(g_tearFlagGlow._h) |
GHIDRA_UINT(g_tearFlagSquare._h) | GHIDRA_UINT(g_tearFlagFlat._h) |
GHIDRA_UINT(g_tearFlagSpiral._h) | GHIDRA_UINT(g_tearFlagPulse._h) |
GHIDRA_UINT(g_tearFlagKnockback._h) | GHIDRA_UINT(g_tearFlagAttractor._h) |
GHIDRA_UINT(g_tearFlagBurn._h) | GHIDRA_UINT(g_tearFlagShrink._h) |
GHIDRA_UINT(g_tearFlagFear._h) | GHIDRA_UINT(g_tearFlagBounce._h) |
GHIDRA_UINT(g_tearFlagHpDrop._h) | GHIDRA_UINT(g_tearFlagConfusion._h) |
GHIDRA_UINT(g_tearFlagCharm._h) | GHIDRA_UINT(g_tearFlagMulligan._h) |
GHIDRA_UINT(g_tearFlagWiggle._h) | GHIDRA_UINT(g_tearFlagPersistent._h) |
GHIDRA_UINT(g_tearFlagGrow._h) | GHIDRA_UINT(g_tearFlagFreeze._h) |
GHIDRA_UINT(g_tearFlagPoison._h) | GHIDRA_UINT(g_tearFlagSlow._h) |
GHIDRA_UINT(g_tearFlagHoming._h) | GHIDRA_UINT(g_tearFlagSpectral._h) |
GHIDRA_UINT(g_tearFlagPiercing._h);
DAT_00c8001c = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagSpore._h)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagOccult._h)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagBait._h)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagMagnetize._h)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagIce._h)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagPunch._h)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagCreepTrail._h)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagHydrobounce._h)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagLasershot._h)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagLaser._h)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagHorn._h)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagJacobs._h)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagNeedle._h)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagMidas._h)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagBelial._h)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagAcid._h)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagEgg._h)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagBooger._h)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagPermanentConfusion._h)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagBigSpiral._h)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagGreedCoin._h)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagGodsFlesh._h)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagBlackHpDrop._h)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagCoinDrop._h)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagLightFromHeaven._h)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagContinuum._h)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagSticky._h)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagMysteriousLiquidCreep._h)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagGish._h)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagGlow._h)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagSquare._h)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagFlat._h)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagSpiral._h)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagPulse._h)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagKnockback._h)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagAttractor._h)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagBurn._h)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagShrink._h)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagFear._h)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagBounce._h)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagHpDrop._h)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagConfusion._h)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagCharm._h)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagMulligan._h)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagWiggle._h)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagPersistent._h)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagGrow._h)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagFreeze._h)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagPoison._h)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagSlow._h)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagHoming._h)) + 0x4))) | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagSpectral._h)) + 0x4))) |
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagPiercing._h)) + 0x4)));
_Init_thread_footer(&DAT_00c80008);
}
uStack_1c = DAT_00c80014 & *GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4));
uStack_20 = DAT_00c80010 & GHIDRA_UINT((this->_tearFlags)._l);
uStack_14 = *GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4)) & DAT_00c8001c;
uStack_18 = DAT_00c80018 & GHIDRA_UINT((this->_tearFlags)._h);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags._l)) + 0x4))) = uStack_1c;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags._l)) + 0x0))) = uStack_20;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags._h)) + 0x0))) = uStack_18;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags._h)) + 0x4))) = uStack_14;
SetTearFlags(childShot,flags);
uVar6 = Random();
(**(code **)(*GHIDRA_CAST<int *>(childShot) + 0x40))
((this->_collisionDamage / 1.5) *
((float)((double)GHIDRA_INT(uVar6) + __uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)]) *
2.3283064e-10 * 0.5 + 0.75));
fVar12 = fVar13 * this->_fScale * 0.55;
if (fVar12 <= 0.01) {
fVar12 = 0.01;
}
childShot->_baseScale = fVar12;
childShot->_fScale = fVar12;
ResetSpriteScale(childShot);
fVar12 = -6.0;
if (this->_height <= -6.0) {
fVar12 = this->_height;
}
childShot->_height = fVar12;
fVar13 = get_height_offset_y(childShot,fVar12);
game = g_game;
(childShot->_posOffset).y = fVar13;
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 8)) == 0x10) &&
((childShot->_posOffset).y = -18.0, -5.1 < fVar12)) {
childShot->_height = -5.1;
}
uVar6 = Random();
childShot->_fallingAccel = 1.3;
childShot->_fallingSpeed =
((float)((double)GHIDRA_INT(uVar6) + __uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)]) *
2.3283064e-10 * 0.75 + 0.5) * (float)this * 0.5;
childShot->SetColor(&(this->_sprite)._color,0xffffffff,0xff,0,1);
childShot->_prismTouched = this->_prismTouched;
childShot->_multidimensionalTouched = this->_multidimensionalTouched;
LAB_00678b68:
childShot->Update();
}
else {
isOwned = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0x76,0);
if (isOwned != 0) {
uVar6 = Random();
childShot = (Entity_Tear *)
Entity_Player::FireDelayedBrimstone
(player,(float)((double)GHIDRA_INT(uVar6) +
__uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)]) *
2.3283064e-10 * 360.0,GHIDRA_CAST<Entity *>(player));
(childShot->_pos).x = (this->_pos).x;
(childShot->_pos).y = (this->_pos).y;
iVar9 = *GHIDRA_CAST<int *>(childShot);
*GHIDRA_CAST<undefined1 *>(&(childShot->_tearHaloANM2)._animState._layerFrames) = 1;
(**(code **)(iVar9 + 0x3c))(&(this->_sprite)._color,0xffffffff,0xff,0,1);
*GHIDRA_CAST<byte *>(&(childShot->_tearHaloANM2)._overlayAnimState._currentlyTriggeredEvents) =
this->_prismTouched;
*GHIDRA_CAST<byte *>(&(childShot->_tearHaloANM2)._overlayAnimState._animData) =
this->_multidimensionalTouched;
goto LAB_00678b68;
}
isOwned = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0x34,0);
if (isOwned == 0) {
isOwned = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0x18b,0);
if (isOwned == 0) {
isOwned = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0x44,0);
if (isOwned == 0) goto LAB_00678885;
uVar6 = Random();
fVar12 = (float)((double)GHIDRA_INT(uVar6) + __uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)]) *
2.3283064e-10 * 360.0 * 0.017453292;
fVar13 = cos(fVar12);
laserDirection.y = sin(fVar12);
laserDirection.x = fVar13 - laserDirection.y * 0.0;
laserDirection.y = fVar13 * 0.0 + laserDirection.y;
childShot = (Entity_Tear *)
Entity_Player::FireTechLaser
(player,&this->_pos,1,&laserDirection,0,0,GHIDRA_CAST<Entity *>(0x0),1.0);
childShot->SetCollisionDamage(childShot->_collisionDamage / 1.5);
(childShot->_pos).x = (this->_pos).x;
(childShot->_pos).y = (this->_pos).y;
iVar9 = *GHIDRA_CAST<int *>(childShot);
*GHIDRA_CAST<undefined1 *>(&(childShot->_tearHaloANM2)._animState._layerFrames) = 1;
(**(code **)(iVar9 + 0x3c))(&(this->_sprite)._color,0xffffffff,0xff,0,1);
*GHIDRA_CAST<byte *>(&(childShot->_tearHaloANM2)._overlayAnimState._currentlyTriggeredEvents) =
this->_prismTouched;
*GHIDRA_CAST<byte *>(&(childShot->_tearHaloANM2)._overlayAnimState._animData) =
this->_multidimensionalTouched;
goto LAB_00678b68;
}
uVar6 = Random();
dVar2 = __uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)];
fVar12 = player->_shotspeed * 10.0;
uVar7 = Random();
fVar13 = (float)((double)GHIDRA_INT(uVar7) + __uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) *
2.3283064e-10 * 360.0 * 0.017453292;
fVar14 = cos(fVar13);
fVar13 = sin(fVar13);
techXVelocity.y = fVar13 * fVar12 + fVar14 * 0.0;
techXVelocity.x = fVar14 * fVar12 - fVar13 * 0.0;
techXLaser = Entity_Player::FireTechXLaser
(player,&this->_pos,&techXVelocity,
(float)((double)GHIDRA_INT(uVar6) + dVar2) * 2.3283064e-10 * 60.0 + 20.0,
GHIDRA_CAST<Entity *>(0x0),1.0);
techXLaser->_prismTouched = this->_prismTouched;
techXLaser->_multidimensionalTouched = this->_multidimensionalTouched;
techXLaser->Update();
}
else {
uVar6 = Random();
fVar12 = ((float)((double)GHIDRA_INT(uVar6) + __uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)]) *
2.3283064e-10 * 4.0 + 3.0) * player->_shotspeed;
uVar6 = Random();
fVar13 = (float)((double)GHIDRA_INT(uVar6) + __uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)]) *
2.3283064e-10 * 360.0 * 0.017453292;
fVar14 = cos(fVar13);
fVar13 = sin(fVar13);
bombVelocity.x = fVar12 * fVar14 - fVar13 * 0.0;
bombVelocity.y = fVar12 * fVar13 + fVar14 * 0.0;
uVar6 = Random();
fVar12 = (float)((double)GHIDRA_INT(uVar6) + __uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)]) *
2.3283064e-10 * 3.14;
fVar12 = fVar12 + fVar12;
uVar6 = Random();
fVar13 = (float)((double)GHIDRA_INT(uVar6) + __uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)]) *
2.3283064e-10;
fVar14 = cos(fVar12);
bombPos.x = fVar14 * fVar13 * 10.0 + (this->_pos).x;
fVar12 = sin(fVar12);
bombPos.y = fVar12 * fVar13 * 10.0 + (this->_pos).y;
childBomb = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::FireBomb(&bombPos,&bombVelocity,GHIDRA_CAST<Entity *>(0x0));
childBomb->SetColor(&(this->_sprite)._color,0xffffffff,0xff,0,1);
childBomb->_prismTouched = this->_prismTouched;
if (this->_canTriggerStreakEnd == 0) {
uVar6 = *GHIDRA_CAST<uint *>((GHIDRA_INT(&(childBomb->_tearFlags)._l) + 4));
qVar5 = (childBomb->_tearFlags)._h;
uVar7 = *GHIDRA_CAST<uint *>((GHIDRA_INT(&(childBomb->_tearFlags)._h) + 4));
uVar11 = ~GHIDRA_UINT(g_tearFlagSadBomb._h);
uVar10 = ~(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagSadBomb._h)) + 0x4)));
uVar8 = ~(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagSadBomb._l)) + 0x4)));
*GHIDRA_CAST<uint *>(&(childBomb->_tearFlags)._l) =
~GHIDRA_UINT(g_tearFlagSadBomb._l) & GHIDRA_UINT((childBomb->_tearFlags)._l);
*GHIDRA_CAST<uint *>((GHIDRA_INT(&(childBomb->_tearFlags)._l) + 4)) = uVar8 & uVar6;
*GHIDRA_CAST<uint *>(&(childBomb->_tearFlags)._h) = uVar11 & GHIDRA_UINT(qVar5);
*GHIDRA_CAST<uint *>((GHIDRA_INT(&(childBomb->_tearFlags)._h) + 4)) = uVar10 & uVar7;
}
childBomb->_loadCostumes = 1;
childBomb->_scale = childBomb->_scale * 0.5;
childBomb->_explosionDamage = childBomb->_explosionDamage * 0.5;
childBomb->_radiusMultiplier = childBomb->_radiusMultiplier * 0.65;
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(childBomb))))->Entity::SetSize(childBomb->_size * 0.5,
(Vector)(CONCAT44(g_vectorOne.y,g_vectorOne.x) ^ 0x8000000080000000),-1);
if ((childBomb->_variant != 0x13) && (childBomb->_variant != 0x14)) {
uVar6 = Random();
childBomb->_fallSpeed =
-3.0 - (float)((double)GHIDRA_INT(uVar6) + __uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)])
* 2.3283064e-10 * 5.0;
uVar6 = (childBomb->_dropRNG)._seed;
if (uVar6 == 0) {
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
uVar6 = (childBomb->_dropRNG)._seed;
if (uVar6 == 0) {
pcVar4 = (code *)swi(3);
(*pcVar4)();
return;
}
}
uVar6 = uVar6 >> ((byte)(childBomb->_dropRNG)._shift1 & 0x1f) ^ uVar6;
uVar6 = uVar6 << ((byte)(childBomb->_dropRNG)._shift2 & 0x1f) ^ uVar6;
uVar6 = uVar6 >> ((byte)(childBomb->_dropRNG)._shift3 & 0x1f) ^ uVar6;
(childBomb->_dropRNG)._seed = uVar6;
(childBomb->_posOffset).x = 0.0;
iVar9 = uVar6 % 0xe + 10;
(childBomb->_posOffset).y = -3.0;
childBomb->_explosionCountdown1 = iVar9;
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((childBomb)) + 0x414)))) = iVar9;
}
*GHIDRA_CAST<uint *>(&childBomb->_flags) = GHIDRA_UINT(childBomb->_flags) | 0x4000000;
puVar1 = GHIDRA_CAST<uint *>((GHIDRA_INT(&childBomb->_flags) + 4));
*puVar1 = *puVar1 | 0x400;
}
}
splitCount = splitCount - 1;
} while (splitCount != 0);
}
return;
}
// 006790c0
void Entity_Tear::Render(Vector *offset)
{
Vector *position;
float fVar1;
byte isLocalPlayer;
Entity_Player *spawnerPlayer;
float fVar2;
float fVar3;
double dVar4;
double dVar5;
ColorMod remoteColor;
float savedTintR;
float savedTintG;
float savedTintB;
float savedTintA;
float savedColorizeR;
float savedColorizeG;
float savedColorizeB;
float savedColorizeA;
undefined4 auStack_6c [26];
undefined8 savedOffsetXY;
ColorMod *spriteColor;
if ((this->_exists != 0) && (this->_visible != 0)) {
fVar3 = g_displayPixelRatio * g_screenPointScale;
dVar4 = floor((double)(((((this->_posOffset).x + (this->_pos).x) - 60.0) * 0.65 +
(g_screenWidth - 338.0) * 0.5) * fVar3 + 0.5));
dVar5 = floor((double)(((((this->_pos).y + (this->_posOffset).y) - 140.0) * 0.65 +
(g_screenHeight - 182.0) * 0.5) * fVar3 + 0.5));
position = &this->_renderPosition;
fVar1 = offset->y;
position->x = (float)dVar4 / fVar3 + offset->x;
(this->_renderPosition).y = (float)dVar5 / fVar3 + fVar1;
if (((GHIDRA_UINT((this->_tearFlags)._l) & GHIDRA_UINT(g_tearFlagGlow._l)) != 0 ||
(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagGlow._l)) + 0x4)))) != 0) ||
((GHIDRA_UINT((this->_tearFlags)._h) & GHIDRA_UINT(g_tearFlagGlow._h)) != 0 ||
(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagGlow._h)) + 0x4)))) != 0)) {
(GHIDRA_CAST<ANM2 *>((&this->_tearHaloANM2)))->ANM2::Render(position,&g_vectorZero,&g_vectorZero);
}
if (((this->_tearEffectANM2)._loaded != 0) &&
((GHIDRA_UINT((this->_tearEffectANM2)._bitflags) >> 0xd & 1) != 0)) {
(GHIDRA_CAST<ANM2 *>((&this->_tearEffectANM2)))->ANM2::Render(position,&g_vectorZero,&g_vectorZero);
}
spawnerPlayer =
(Entity_Player *)
__RTDynamicCast(this->_spawnerEntity,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
&IsaacRepentancePlus::Entity_Player::RTTI_Type_Descriptor);
savedTintR = (this->_sprite)._color._tint[0];
savedTintG = (this->_sprite)._color._tint[1];
savedTintB = (this->_sprite)._color._tint[2];
savedTintA = (this->_sprite)._color._tint[3];
spriteColor = &(this->_sprite)._color;
fVar1 = (this->_sprite)._color._offset[2];
savedColorizeR = (this->_sprite)._color._colorize[0];
savedColorizeG = (this->_sprite)._color._colorize[1];
savedColorizeB = (this->_sprite)._color._colorize[2];
savedColorizeA = (this->_sprite)._color._colorize[3];
savedOffsetXY = *GHIDRA_CAST<undefined8 *>((this->_sprite)._color._offset);
if ((spawnerPlayer != GHIDRA_CAST<Entity_Player *>(0x0)) &&
(g_manager->_netplayManager != *GHIDRA_CAST<NetplayManager *>((g_manager + 1)))) {
isLocalPlayer =
NetplayManager::IsIdxLocalPlayer
(&g_manager->_netplayManager,spawnerPlayer->_controllerIndex);
if (isLocalPlayer == 0) {
remoteColor._colorize[0] = (this->_sprite)._color._colorize[0];
remoteColor._colorize[1] = (this->_sprite)._color._colorize[1];
remoteColor._colorize[2] = (this->_sprite)._color._colorize[2];
remoteColor._colorize[3] = (this->_sprite)._color._colorize[3];
remoteColor._tint[0] = spriteColor->_tint[0];
remoteColor._tint[1] = (this->_sprite)._color._tint[1];
remoteColor._tint[2] = (this->_sprite)._color._tint[2];
fVar3 = (this->_sprite)._color._tint[3];
remoteColor._offset[2] = (this->_sprite)._color._offset[2];
fVar2 = (this->_sprite)._color._offset[0];
remoteColor._offset[1] = (this->_sprite)._color._offset[1];
remoteColor._tint[3] = fVar3;
remoteColor._offset[0] = fVar2;
FUN_00925df0();
remoteColor._tint[3] = fVar2 * fVar3;
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::SetColor(&remoteColor);
}
}
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::Render(offset);
if (spriteColor != GHIDRA_CAST<ColorMod *>(auStack_6c)) {
spriteColor->_tint[0] = savedTintR;
(this->_sprite)._color._tint[1] = savedTintG;
(this->_sprite)._color._tint[2] = savedTintB;
(this->_sprite)._color._tint[3] = savedTintA;
(this->_sprite)._color._colorize[0] = savedColorizeR;
(this->_sprite)._color._colorize[1] = savedColorizeG;
(this->_sprite)._color._colorize[2] = savedColorizeB;
(this->_sprite)._color._colorize[3] = savedColorizeA;
*GHIDRA_CAST<undefined8 *>((this->_sprite)._color._offset) = savedOffsetXY;
(this->_sprite)._color._offset[2] = fVar1;
}
if (((this->_tearEffectANM2)._loaded != 0) &&
((GHIDRA_UINT((this->_tearEffectANM2)._bitflags) >> 0xd & 1) == 0)) {
(GHIDRA_CAST<ANM2 *>((&this->_tearEffectANM2)))->ANM2::Render(position,&g_vectorZero,&g_vectorZero);
}
if (this->_deadEyeIntensity != 0.0) {
(GHIDRA_CAST<ANM2 *>((&this->_deadEyeANM2)))->ANM2::Render(position,&g_vectorZero,&g_vectorZero);
}
FUN_00862b80(this,offset);
}
return;
}
// 00679400
void Entity_Tear::Interpolate()
{
byte isFlagSet;
int iVar1;
int playerLaser;
Vector *pVVar2;
int extraout_EDX;
uint uVar3;
EntityPtr EVar4;
Game *game;
float fVar5;
undefined1 *puVar6;
float fVar7;
float fVar8;
Vector local_34;
undefined1 *local_2c;
float local_28;
Vector local_24;
Entity_Tear *local_1c;
undefined1 auStack_18 [8];
uint uStack_10;
uint uStack_c;
EntityPtr nextSpawner;
EntityPtr spawner;
Entity_Tear *tear;
uint tearFlagsLo;
if (0 < this->_holdTimer) {
EVar4 = this->_parent;
if (EVar4 == (EntityPtr)0x0) {
return;
}
fVar5 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar4) + 0x340));
fVar8 = (this->_holdOffset).y;
(this->_pos).x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar4) + 0x33c)) + (this->_holdOffset).x;
(this->_pos).y = fVar5 + fVar8;
return;
}
uVar3 = GHIDRA_UINT((this->_tearFlags)._h);
local_2c = GHIDRA_CAST<undefined1 *>((uVar3 & GHIDRA_UINT(g_tearFlagTractorBeam._h)));
tearFlagsLo = GHIDRA_UINT((this->_tearFlags)._l);
local_34.x = (float)(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagTractorBeam._h)) + 0x4))));
local_1c = this;
if (((tearFlagsLo & GHIDRA_UINT(g_tearFlagTractorBeam._l)) != 0 ||
(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagTractorBeam._l)) + 0x4)))) != 0) ||
(local_2c != GHIDRA_CAST<undefined1 *>(0x0) || local_34.x != 0.0)) {
if ((((tearFlagsLo & GHIDRA_UINT(g_tearFlagLudovico._l)) == 0 &&
(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagLudovico._l)) + 0x4)))) == 0) &&
((((uVar3 & GHIDRA_UINT(g_tearFlagLudovico._h)) == 0 &&
(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagLudovico._h)) + 0x4)))) == 0 &&
(EVar4 = this->_parent, EVar4 != (EntityPtr)0x0)) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar4) + 0x28)) == 1))))
&& (this->_stickTarget == (void *)0x0)) {
iVar1 = __RTDynamicCast(EVar4,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
&IsaacRepentancePlus::Entity_Player::RTTI_Type_Descriptor,0);
playerLaser = __RTDynamicCast(*GHIDRA_CAST<undefined4 *>((iVar1 + 0x1430)),0,
&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
&IsaacRepentancePlus::Entity_Laser::RTTI_Type_Descriptor,0);
if (playerLaser != 0) {
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auStack_18)) + 0x0))) = GHIDRA_UINT((this->_tearFlags)._l) & GHIDRA_UINT(g_tearFlagBoomerang._l);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auStack_18)) + 0x4))) = *GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagBoomerang._l)) + 0x4)))
;
fVar5 = (this->_pos).x - *GHIDRA_CAST<float *>((iVar1 + 0x33c));
fVar8 = (this->_pos).y - *GHIDRA_CAST<float *>((iVar1 + 0x340));
uStack_10 = GHIDRA_UINT((this->_tearFlags)._h) & GHIDRA_UINT(g_tearFlagBoomerang._h);
uStack_c = *GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagBoomerang._h)) + 0x4)));
local_2c = GHIDRA_CAST<undefined1 *>(0x3f800000);
local_28 = fVar8;
local_24.x = fVar5;
isFlagSet = (GHIDRA_CAST<BitSet128 *>((GHIDRA_CAST<BitSet128 *>(auStack_18))))->BitSet128::IsNonZero();
if ((isFlagSet != 0) && (fVar8 * (this->_velocity).y + fVar5 * (this->_velocity).x < 0.0)) {
local_2c = &DAT_bf800000;
}
local_34.x = *GHIDRA_CAST<float *>((extraout_EDX + 0x41c)) * 0.017453292;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auStack_18)) + 0x0))) = cos(local_34.x);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auStack_18)) + 0x4))) = sin(local_34.x);
fVar5 = (this->_velocity).y;
fVar8 = (this->_velocity).x;
fVar5 = sqrtf(fVar8 * fVar8 + fVar5 * fVar5);
pVVar2 = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(auStack_18))))->Vector::Resized(&local_34,fVar5);
fVar5 = pVVar2->y;
(this->_velocity).x = (float)local_2c * pVVar2->x;
(this->_velocity).y = (float)local_2c * fVar5;
fVar8 = sqrtf(local_28 * local_28 + local_24.x * local_24.x);
fVar5 = *GHIDRA_CAST<float *>((iVar1 + 0x33c));
(this->_pos).y = fVar8 * (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)auStack_18)) + 0x4))) + *GHIDRA_CAST<float *>((iVar1 + 0x340));
(this->_pos).x = fVar8 * (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)auStack_18)) + 0x0))) + fVar5;
}
}
}
uVar3 = GHIDRA_UINT((this->_tearFlags)._h);
local_24.x = (float)(uVar3 & GHIDRA_UINT(g_tearFlagLaser._h));
local_34.x = *GHIDRA_CAST<float *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4));
local_28 = (float)(GHIDRA_UINT(local_34.x) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagLaser._h)) + 0x4))));
if (((!((GHIDRA_UINT((this->_tearFlags)._l) & GHIDRA_UINT(g_tearFlagLaser._l)) == 0 &&
(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagLaser._l)) + 0x4)))) == 0)) ||
(!(local_24.x == 0.0 && local_28 == 0.0))) &&
((this->_techZeroLaser != (EntityPtr)0x0 && (this->_techZeroTarget != (EntityPtr)0x0)))) {
iVar1 = __RTDynamicCast(this->_techZeroLaser,0,
&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
&IsaacRepentancePlus::Entity_Laser::RTTI_Type_Descriptor,0);
EVar4 = this->_techZeroTarget;
local_28 = (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar4) + 0x33c)) + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar4) + 0x34c))) -
((this->_velocity).x + (this->_pos).x + (this->_posOffset).x);
local_24.x = (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar4) + 0x340)) + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar4) + 0x350))) -
((this->_velocity).y + (this->_pos).y + (this->_posOffset).y);
fVar5 = atan2f(local_24.x,local_28);
fVar5 = fVar5 * 57.295776;
*GHIDRA_CAST<undefined4 *>((iVar1 + 0x420)) = *GHIDRA_CAST<undefined4 *>((iVar1 + 0x41c));
*GHIDRA_CAST<float *>((iVar1 + 0x418)) = fVar5;
*GHIDRA_CAST<float *>((iVar1 + 0x41c)) = fVar5;
*GHIDRA_CAST<float *>((iVar1 + 0xec)) = fVar5 - 90.0;
fVar5 = sqrtf(local_24.x * local_24.x + local_28 * local_28);
*GHIDRA_CAST<float *>((iVar1 + 0x4d0)) = fVar5;
fVar5 = (this->_posOffset).y;
fVar8 = (this->_pos).y;
fVar7 = (this->_velocity).y;
*GHIDRA_CAST<float *>((iVar1 + 0x33c)) =
((this->_posOffset).x + (this->_pos).x + (this->_velocity).x) - *GHIDRA_CAST<float *>((iVar1 + 0x34c));
*GHIDRA_CAST<float *>((iVar1 + 0x340)) = (fVar5 + fVar8 + fVar7) - *GHIDRA_CAST<float *>((iVar1 + 0x350));
uVar3 = GHIDRA_UINT((this->_tearFlags)._h);
local_34.x = *GHIDRA_CAST<float *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4));
}
tear = local_1c;
local_24.x = (float)(uVar3 & GHIDRA_UINT(g_tearFlagLudovico._h));
if (((GHIDRA_UINT((this->_tearFlags)._l) & GHIDRA_UINT(g_tearFlagLudovico._l)) == 0 &&
(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagLudovico._l)) + 0x4)))) == 0) &&
(local_24.x == 0.0 && (GHIDRA_UINT(local_34.x) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagLudovico._h)) + 0x4)))) == 0)) {
nextSpawner = this->_spawnerEntity;
EVar4 = (EntityPtr)this;
while (spawner = nextSpawner, spawner != (EntityPtr)0x0) {
EVar4 = spawner;
nextSpawner = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(spawner) + 0x3c8));
}
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar4) + 0x28)) != 1) {
EVar4 = (EntityPtr)0x0;
}
if (((GHIDRA_UINT((this->_tearFlags)._l) & GHIDRA_UINT(g_tearFlagWiggle._l)) != 0 ||
(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagWiggle._l)) + 0x4)))) != 0) ||
((uVar3 & GHIDRA_UINT(g_tearFlagWiggle._h)) != 0 ||
(GHIDRA_UINT(local_34.x) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagWiggle._h)) + 0x4)))) != 0)) {
if (EVar4 == (EntityPtr)0x0) {
fVar5 = 1.0;
}
else {
fVar5 = get_tear_trinket_multiplier(GHIDRA_CAST<Entity_Player *>(EVar4),10);
if (fVar5 <= 1.0) {
fVar5 = 1.0;
}
}
apply_wiggle(tear,fVar5);
}
local_1c = (Entity_Tear *)
(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(tear->_tearFlags)._h) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagSpiral._h)) + 0x4))));
if (((GHIDRA_UINT((tear->_tearFlags)._l) & GHIDRA_UINT(g_tearFlagSpiral._l)) != 0 ||
(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(tear->_tearFlags)._l) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagSpiral._l)) + 0x4)))) != 0) ||
((GHIDRA_UINT((tear->_tearFlags)._h) & GHIDRA_UINT(g_tearFlagSpiral._h)) != 0 ||
local_1c != GHIDRA_CAST<Entity_Tear *>(0x0))) {
if (EVar4 == (EntityPtr)0x0) {
fVar5 = 1.0;
}
else {
playerLaser = (GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(EVar4))))->Entity_Player::GetTrinketMultiplier(0xb);
iVar1 = 1;
if (1 < playerLaser) {
iVar1 = playerLaser;
}
fVar5 = (float)iVar1;
if (fVar5 <= 1.0) {
fVar5 = 1.0;
}
}
apply_wiggle(tear,fVar5);
}
local_1c = (Entity_Tear *)
(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(tear->_tearFlags)._h) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagBigSpiral._h)) + 0x4))));
if (((GHIDRA_UINT((tear->_tearFlags)._l) & GHIDRA_UINT(g_tearFlagBigSpiral._l)) != 0 ||
(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(tear->_tearFlags)._l) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagBigSpiral._l)) + 0x4)))) != 0) ||
((GHIDRA_UINT((tear->_tearFlags)._h) & GHIDRA_UINT(g_tearFlagBigSpiral._h)) != 0 ||
local_1c != GHIDRA_CAST<Entity_Tear *>(0x0))) {
if (EVar4 != (EntityPtr)0x0) {
(GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(EVar4))))->Entity_Player::GetTrinketMultiplier(0x60);
}
update_wiggle(tear);
}
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(tear))))->Entity::Interpolate();
this = tear;
}
else {
if ((this->_subtype & 2) != 0) {
uVar3 = GHIDRA_UINT(this->_flags);
if ((uVar3 & 2) != 0) {
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&this->_flags) + 4)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&this->_flags) + 4));
*GHIDRA_CAST<uint *>(&this->_flags) = uVar3 & 0xfffffffd;
return;
}
}
pVVar2 = &this->_pos;
(this->_preInterpolatePos).x = (this->_pos).x;
(this->_preInterpolatePos).y = (this->_pos).y;
fVar5 = this->_friction;
fVar8 = (this->_velocity).y;
fVar7 = this->_speedMultiplier;
puVar6 = GHIDRA_CAST<undefined1 *>((fVar5 * (this->_velocity).x * fVar7 * 0.5 + pVVar2->x));
pVVar2->x = (float)puVar6;
(this->_pos).y = fVar8 * fVar5 * fVar7 * 0.5 + (this->_pos).y;
this->_isInterpolating = 1;
local_34.x = *GHIDRA_CAST<float *>(&this->_parent);
if (((EntityPtr)local_34.x == (EntityPtr)0x0) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_34.x) + 0x28)) != 2)) {
local_1c = GHIDRA_CAST<Entity_Tear *>((GHIDRA_UINT((this->_tearFlags)._h) & GHIDRA_UINT(g_tearFlagContinuum._h)));
local_24.x = (float)(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagContinuum._h)) + 0x4)))
);
if (((GHIDRA_UINT((this->_tearFlags)._l) & GHIDRA_UINT(g_tearFlagContinuum._l)) == 0 &&
(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagContinuum._l)) + 0x4)))) == 0) &&
(local_1c == GHIDRA_CAST<Entity_Tear *>(0x0) && local_24.x == 0.0)) {
Room::GetClampedPositionImpl(g_game->_room,GHIDRA_CAST<Vector *>(auStack_18),pVVar2,0.0,0.0,0.0,0.0);
pVVar2->x = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)auStack_18)) + 0x0)));
(this->_pos).y = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)auStack_18)) + 0x4)));
local_34.x = *GHIDRA_CAST<float *>(&this->_parent);
puVar6 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<undefined1 *>(auStack_18))) + 0x4)));
}
if (((EntityPtr)local_34.x != (EntityPtr)0x0) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_34.x) + 0x28)) == 2))
goto LAB_00679c17;
}
else {
LAB_00679c17:
if ((this->_subtype & 1) != 0) {
local_1c = (Entity_Tear *)
((((float)(GHIDRA_UINT(this->_index) % 10) + 0.0) * 0.1 * 0.5 + 2.0) * 0.017453292);
local_2c = GHIDRA_CAST<undefined1 *>(cos((float)local_1c));
fVar7 = sin((float)local_1c);
fVar5 = (this->_parentOffset).x;
fVar8 = (this->_parentOffset).y;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auStack_18)) + 0x4))) = (float)local_2c * fVar8 + fVar7 * fVar5;
local_28 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_34.x) + 0x33c));
local_34.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_34.x) + 0x340));
local_1c = GHIDRA_CAST<Entity_Tear *>(((float)local_2c * fVar5 - fVar7 * fVar8));
iVar1 = this->_index * 0x32;
local_2c = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<undefined1 *>(auStack_18))) + 0x4)));
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auStack_18)) + 0x0))) = local_1c;
local_24.x = sin(((float)(g_game->_frameCount - this->_spawnFrame) + 0.5 +
(float)((double)iVar1 + __uint_to_double_fixup[-(iVar1 >> 0x1f)])) * 0.08);
fVar5 = sqrtf((float)local_1c * (float)local_1c + (float)local_2c * (float)local_2c);
pVVar2 = (GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>(auStack_18))))->Vector::Resized(&local_24,fVar5 * (local_24.x * 0.5 + 1.0));
puVar6 = GHIDRA_CAST<undefined1 *>((local_28 + pVVar2->x));
fVar5 = pVVar2->y;
(this->_pos).x = (float)puVar6;
(this->_pos).y = local_34.x + fVar5;
}
}
if (((GHIDRA_UINT((this->_tearFlags)._l) & GHIDRA_UINT(g_tearFlagHydrobounce._l)) != 0 ||
(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagHydrobounce._l)) + 0x4)))) != 0) ||
((GHIDRA_UINT((this->_tearFlags)._h) & GHIDRA_UINT(g_tearFlagHydrobounce._h)) != 0 ||
(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagHydrobounce._h)) + 0x4)))) != 0)) {
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::GetRootParent();
game = g_game;
fVar5 = sin(((float)(g_game->_frameCount - this->_spawnFrame) + 0.5) *
(3.1415927 / (float)puVar6));
(this->_posOffset).y = ABS(fVar5) * this->_height;
goto LAB_00679a3a;
}
}
game = g_game;
LAB_00679a3a:
if (this->_waitFrames < 1) {
local_1c = (Entity_Tear *)
(*GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagLudovico._h)) + 0x4))));
if ((((GHIDRA_UINT(g_tearFlagLudovico._l) & GHIDRA_UINT((this->_tearFlags)._l)) == 0 &&
((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagLudovico._l)) + 0x4))) & *GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4))) == 0) &&
((GHIDRA_UINT((this->_tearFlags)._h) & GHIDRA_UINT(g_tearFlagLudovico._h)) == 0 &&
local_1c == GHIDRA_CAST<Entity_Tear *>(0x0))) && (this->_dead == 0)) {
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 8)) == 0x10) {
(this->_posOffset).y = -18.0;
return;
}
fVar5 = get_height_offset_y(this,this->_fallingSpeed * this->_speedMultiplier * 0.5 +
this->_height);
(this->_posOffset).y = fVar5;
}
}
return;
}
// 00679e80
void Entity_Tear::SetDeadEyeIntensity(float intensity)
{
LayerState *effectLayer;
char *ptr;
int blendMode;
uint uVar1;
ColorMod *effectColor;
undefined4 local_68 [11];
std_string anm2Path;
uint local_24;
undefined1 *puStack_20;
void *local_1c;
undefined1 *puStack_18;
undefined4 local_14;
puStack_20 = GHIDRA_CAST<undefined1 *>((local_68 + 0x19));
local_14 = 0xffffffff;
puStack_18 = &LAB_00af33dd;
local_1c = ExceptionList;
local_24 = __security_cookie ^ GHIDRA_UINT((local_68 + 0x16));
ExceptionList = &local_1c;
this->_deadEyeIntensity = intensity;
if ((intensity != 0.0) && ((this->_deadEyeANM2)._loaded == 0)) {
anm2Path._size = 0;
anm2Path._capacity = 0xf;
anm2Path._buf[0] = '\0';
anm2Path._buf[1] = '\0';
anm2Path._buf[2] = '\0';
anm2Path._buf[3] = '\0';
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) = std::_Allocate(0x20);
anm2Path._size = 0x1a;
anm2Path._capacity = 0x1f;
builtin_strncpy((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0))),"gfx/DeadEyeTearEffect.anm2",0x1b);
local_14 = 0;
(GHIDRA_CAST<ANM2 *>((&this->_deadEyeANM2)))->ANM2::Load(&anm2Path,1);
local_14 = 0xffffffff;
if (0xf < anm2Path._capacity) {
uVar1 = anm2Path._capacity + 1;
ptr = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0)));
if (0xfff < uVar1) {
ptr = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + -4));
uVar1 = anm2Path._capacity + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + (-4 - GHIDRA_INT(ptr))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(ptr,uVar1);
}
uVar1 = g_graphicsManager_flags;
effectLayer = (GHIDRA_CAST<ANM2 *>((&this->_deadEyeANM2)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x0));
blendMode = 1;
if ((uVar1 & 4) == 0) {
blendMode = 6;
}
effectLayer->_blendMode[1] = blendMode;
effectLayer->_blendMode[0] = 0;
effectLayer->_blendMode[2] = 1;
effectLayer->_blendMode[3] = 1;
effectLayer->_blendMode[4] = 1;
(GHIDRA_CAST<ANM2 *>((&this->_deadEyeANM2)))->ANM2::Play(s_Idle,0);
effectColor = &(this->_deadEyeANM2)._color;
if (effectColor != GHIDRA_CAST<ColorMod *>(local_68)) {
(this->_deadEyeANM2)._color._colorize[0] = 0.0;
(this->_deadEyeANM2)._color._colorize[1] = 0.0;
(this->_deadEyeANM2)._color._colorize[2] = 0.0;
(this->_deadEyeANM2)._color._colorize[3] = 0.0;
effectColor->_tint[0] = 1.0;
(this->_deadEyeANM2)._color._tint[1] = 1.0;
(this->_deadEyeANM2)._color._tint[2] = 1.0;
(this->_deadEyeANM2)._color._tint[3] = intensity;
(this->_deadEyeANM2)._color._offset[0] = 0.0;
(this->_deadEyeANM2)._color._offset[1] = 0.0;
(this->_deadEyeANM2)._color._offset[2] = 0.0;
}
}
ExceptionList = local_1c;
return;
}
// 0067a190
Entity_Tear * Entity_Tear::MakeMultidimensionalCopy(Entity *spawner)
{
BitSet128 flags;
Entity *spawned;
Entity_Tear *copy;
uint variant;
float fVar1;
EntityPtr aEStack_28 [2];
uint uStack_20;
uint uStack_1c;
uint uStack_18;
uint uStack_14;
Game *game;
EntityPtr *refSlot;
variant = this->_variant;
if (((variant != 0x23) && (variant != 0x25)) && (variant != 0x26)) {
variant = 0x15;
}
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(2,variant,&this->_pos,&this->_velocity,spawner,this->_subtype,
(this->_dropRNG)._seed,0);
copy = (Entity_Tear *)
__RTDynamicCast(spawned,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
&IsaacRepentancePlus::Entity_Tear::RTTI_Type_Descriptor,0);
aEStack_28[0] = (EntityPtr)this->_height;
copy->_height = (float)aEStack_28[0];
fVar1 = get_height_offset_y(copy,(float)aEStack_28[0]);
game = g_game;
(copy->_posOffset).y = fVar1;
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 8)) == 0x10) &&
((copy->_posOffset).y = -18.0, -5.1 < (float)aEStack_28[0])) {
copy->_height = -5.1;
}
copy->_fallingSpeed = this->_fallingSpeed;
copy->_fallingAccel = this->_fallingAccel;
copy->_homingFriction = this->_homingFriction;
copy->_tearRange = this->_tearRange;
fVar1 = this->_fScale;
if (fVar1 <= 0.01) {
fVar1 = 0.01;
}
copy->_baseScale = fVar1;
copy->_fScale = fVar1;
ResetSpriteScale(copy);
uStack_1c = ~(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagLudovico._l)) + 0x4))) & *GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._l) + 4));
uStack_20 = ~GHIDRA_UINT(g_tearFlagLudovico._l) & GHIDRA_UINT((this->_tearFlags)._l);
uStack_14 = ~(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagLudovico._h)) + 0x4))) & *GHIDRA_CAST<uint *>((GHIDRA_INT(&(this->_tearFlags)._h) + 4));
uStack_18 = ~GHIDRA_UINT(g_tearFlagLudovico._h) & GHIDRA_UINT((this->_tearFlags)._h);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags._l)) + 0x4))) = uStack_1c;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags._l)) + 0x0))) = uStack_20;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags._h)) + 0x0))) = uStack_18;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags._h)) + 0x4))) = uStack_14;
SetTearFlags(copy,flags);
copy->_waitFrames = this->_waitFrames;
copy->_tearIdx = this->_tearIdx;
copy->SetCollisionDamage(this->_collisionDamage);
copy->_rotation = this->_rotation;
copy->_knockbackMultiplier = this->_knockbackMultiplier;
SetDeadEyeIntensity(copy,this->_deadEyeIntensity);
copy->_multidimensionalTouched = this->_multidimensionalTouched;
(copy->_continueVelocity).x = (this->_continueVelocity).x;
(copy->_continueVelocity).y = (this->_continueVelocity).y;
aEStack_28[0] = this->_parent;
refSlot = &copy->_parent;
if (*refSlot != (EntityPtr)0x0) {
std::multiset<unsigned_int>::erase(GHIDRA_INT(aEStack_28) + 0xfffffffc);
}
*refSlot = aEStack_28[0];
if (aEStack_28[0] != (EntityPtr)0x0) {
std::multiset<unsigned_int>::insert(refSlot);
}
refSlot = &copy->_spawnerEntity;
if (copy->_spawnerEntity != (EntityPtr)0x0) {
aEStack_28[0] = (EntityPtr)refSlot;
std::multiset<unsigned_int>::erase(aEStack_28);
}
*refSlot = (EntityPtr)spawner;
if (spawner != GHIDRA_CAST<Entity *>(0x0)) {
std::multiset<unsigned_int>::insert(refSlot);
}
return copy;
}
// 0067a400
void Entity_Tear::ChangeVariant(int variant)
{
byte isGfuelSeed;
LayerState *layer;
int blendSrc;
char *freeBlock;
uint uVar1;
std_string bulletAnmPath;
std_string missileAnmPath;
uint local_24;
undefined1 *puStack_20;
void *local_1c;
undefined1 *puStack_18;
undefined4 local_14;
float savedCollisionDamage;
int savedGridCollisionClass;
float savedScale;
puStack_20 = GHIDRA_CAST<undefined1 *>((GHIDRA_INT(register0x00000010) + -4));
local_14 = 0xffffffff;
puStack_18 = &LAB_00af79f5;
local_1c = ExceptionList;
local_24 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 0x10U;
ExceptionList = &local_1c;
savedGridCollisionClass = this->_entityGridCollisionClass;
savedCollisionDamage = this->_collisionDamage;
this->_variant = variant;
savedScale = this->_fScale;
this->LoadEntityConfig(local_24);
if (this->_config != (void *)0x0) {
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Load(GHIDRA_CAST<std_string *>((GHIDRA_INT(this->_config) + 0x74)),1);
if (this->_variant == 0xd) {
isGfuelSeed = (GHIDRA_CAST<Seeds *>((&g_game->_seedEffects)))->Seeds::HasSeedEffect(0x4f);
if (isGfuelSeed != 0) {
bulletAnmPath._size = 0;
bulletAnmPath._capacity = 0xf;
bulletAnmPath._buf[0] = '\0';
bulletAnmPath._buf[1] = '\0';
bulletAnmPath._buf[2] = '\0';
bulletAnmPath._buf[3] = '\0';
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(bulletAnmPath._buf)) + 0x0))) = std::_Allocate(0x30);
bulletAnmPath._size = 0x20;
bulletAnmPath._capacity = 0x2f;
builtin_strncpy((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(bulletAnmPath._buf))) + 0x0))),"gfx/promo/gfuel/bullet tear.anm2",0x21);
local_14 = 0;
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Load(&bulletAnmPath,1);
local_14 = 0xffffffff;
if (0xf < bulletAnmPath._capacity) {
uVar1 = bulletAnmPath._capacity + 1;
freeBlock = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(bulletAnmPath._buf))) + 0x0)));
if (0xfff < uVar1) {
freeBlock = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(bulletAnmPath._buf)) + 0x0))) + -4));
uVar1 = bulletAnmPath._capacity + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(bulletAnmPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(freeBlock,uVar1);
}
uVar1 = g_graphicsManager_flags;
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x0));
blendSrc = 1;
if ((uVar1 & 4) == 0) {
blendSrc = 6;
}
layer->_blendMode[0] = 0;
layer->_blendMode[1] = blendSrc;
layer->_blendMode[2] = 1;
layer->_blendMode[3] = 1;
layer->_blendMode[4] = 1;
}
}
else if (this->_variant == 0x17) {
isGfuelSeed = (GHIDRA_CAST<Seeds *>((&g_game->_seedEffects)))->Seeds::HasSeedEffect(0x4f);
if (isGfuelSeed != 0) {
missileAnmPath._size = 0;
missileAnmPath._capacity = 0xf;
missileAnmPath._buf[0] = '\0';
missileAnmPath._buf[1] = '\0';
missileAnmPath._buf[2] = '\0';
missileAnmPath._buf[3] = '\0';
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(missileAnmPath._buf)) + 0x0))) = std::_Allocate(0x20);
missileAnmPath._size = 0x1c;
missileAnmPath._capacity = 0x1f;
builtin_strncpy((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(missileAnmPath._buf))) + 0x0))),"gfx/promo/gfuel/missile.anm2",0x1d);
local_14 = 1;
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Load(&missileAnmPath,1);
local_14 = 0xffffffff;
if (0xf < missileAnmPath._capacity) {
uVar1 = missileAnmPath._capacity + 1;
freeBlock = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(missileAnmPath._buf))) + 0x0)));
if (0xfff < uVar1) {
freeBlock = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(missileAnmPath._buf)) + 0x0))) + -4));
uVar1 = missileAnmPath._capacity + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(missileAnmPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(freeBlock,uVar1);
}
uVar1 = g_graphicsManager_flags;
missileAnmPath._size = 0;
missileAnmPath._capacity = 0xf;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(missileAnmPath._buf)) + 0x0))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(missileAnmPath._buf)) + 0x0))) & 0xffffff00;
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x1));
blendSrc = 1;
if ((uVar1 & 4) == 0) {
blendSrc = 6;
}
layer->_blendMode[1] = blendSrc;
layer->_blendMode[0] = 0;
layer->_blendMode[2] = 1;
layer->_blendMode[3] = 1;
layer->_blendMode[4] = 1;
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x1));
layer->_bitflags = layer->_bitflags | 1;
}
}
}
this->_fScale = savedScale;
ResetSpriteScale(this);
this->_collisionDamage = savedCollisionDamage;
this->_entityGridCollisionClass = savedGridCollisionClass;
ExceptionList = local_1c;
return;
}
// 0067a770
int Entity_Tear::find_nearest_linkable_tear()
{
int iVar1;
void *tearsData;
qword *allocCounter;
int iVar2;
int nearestTear;
uint uVar3;
float fVar4;
float dx;
EntityList_EL local_2c;
float nearestDist;
int nearestTearSaved;
int selfTear;
void *local_10;
undefined1 *puStack_c;
undefined4 uStack_8;
qword oldAllocated;
uStack_8 = 0xffffffff;
puStack_c = &LAB_00af7a20;
local_10 = ExceptionList;
ExceptionList = &local_10;
EntityList::QuerySublist(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),&local_2c,2,-1,-1,0,0);
nearestTear = 0;
uVar3 = 0;
nearestDist = 40.0;
nearestTearSaved = 0;
if (local_2c._size != 0) {
tearsData = local_2c._data;
iVar2 = selfTear;
do {
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(tearsData) + uVar3 * 4));
if (iVar1 != iVar2) {
if (((((*GHIDRA_CAST<uint *>((iVar1 + 0x428)) & GHIDRA_UINT(g_tearFlagChain._l)) == 0 &&
(*GHIDRA_CAST<uint *>((iVar1 + 0x42c)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagChain._l)) + 0x4)))) == 0) &&
((*GHIDRA_CAST<uint *>((iVar1 + 0x430)) & GHIDRA_UINT(g_tearFlagChain._h)) == 0 &&
(*GHIDRA_CAST<uint *>((iVar1 + 0x434)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagChain._h)) + 0x4)))) == 0)) ||
((*GHIDRA_CAST<int *>((iVar1 + 0x494)) != 0 && (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((iVar1 + 0x494)) + 0x28)) == 2)))) ||
(fVar4 = *GHIDRA_CAST<float *>((selfTear + 0x340)) - *GHIDRA_CAST<float *>((iVar1 + 0x340)),
dx = *GHIDRA_CAST<float *>((selfTear + 0x33c)) - *GHIDRA_CAST<float *>((iVar1 + 0x33c)),
fVar4 = sqrtf(fVar4 * fVar4 + dx * dx), nearestDist <= fVar4)) {
tearsData = local_2c._data;
iVar2 = selfTear;
nearestTear = nearestTearSaved;
}
else {
tearsData = local_2c._data;
iVar2 = selfTear;
nearestTear = iVar1;
nearestDist = fVar4;
nearestTearSaved = iVar1;
}
}
uVar3 = uVar3 + 1;
} while (uVar3 < GHIDRA_UINT(local_2c._size));
}
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_2c)) + 0x0))) == '\0') {
if (g_mainHeap == (void *)0x0) {
allocCounter = &g_allocatedBytesNoHeap;
}
else {
allocCounter = GHIDRA_CAST<qword *>((GHIDRA_INT(g_mainHeap) + 0x30));
}
if (local_2c._data != (void *)0x0) {
uVar3 = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(local_2c._data) + -4));
oldAllocated = *allocCounter;
*GHIDRA_CAST<uint *>(allocCounter) = GHIDRA_UINT(*allocCounter) - uVar3;
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(oldAllocated) < uVar3));
free(GHIDRA_CAST<uint *>((GHIDRA_INT(local_2c._data) + -4)));
}
}
ExceptionList = local_10;
return nearestTear;
}
// 0067a8f0
Entity_Tear * Entity_Tear::find_link_partner()
{
uint uVar1;
bool bVar2;
bool bVar3;
qword qVar4;
void *tearData;
qword *allocatedBytes;
EntityPtr chainTear;
Entity_Tear *partner;
bool isNotSelf;
float fVar5;
float dx;
EntityList_EL local_30;
float nearestDistance;
uint i;
Entity_Tear *nearestTear;
EntityPtr self;
void *local_10;
undefined1 *puStack_c;
undefined4 uStack_8;
uStack_8 = 0xffffffff;
puStack_c = &LAB_00af4e20;
local_10 = ExceptionList;
ExceptionList = &local_10;
self = (EntityPtr)this;
EntityList::QuerySublist(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),&local_30,2,-1,-1,0,0);
partner = GHIDRA_CAST<Entity_Tear *>(0x0);
nearestDistance = 20.0;
nearestTear = GHIDRA_CAST<Entity_Tear *>(0x0);
i = 0;
if (local_30._size != 0) {
tearData = local_30._data;
do {
chainTear = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(tearData) + i * 4));
if (chainTear != (EntityPtr)this) {
this = GHIDRA_CAST<Entity_Tear *>(self);
if ((((*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(chainTear) + 0x428)) & GHIDRA_UINT(g_tearFlagChain._l)) == 0 &&
(*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(chainTear) + 0x42c)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagChain._l)) + 0x4)))) == 0) &&
((*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(chainTear) + 0x430)) & GHIDRA_UINT(g_tearFlagChain._h)) == 0 &&
(*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(chainTear) + 0x434)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagChain._h)) + 0x4)))) == 0)) ||
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(chainTear) + 0x498)) != 0)) {
tearData = local_30._data;
}
else {
bVar3 = true;
do {
if (chainTear == (EntityPtr)0x0) goto LAB_0067aa2a;
if (((GHIDRA_UINT((GHIDRA_CAST<BitSet128 *>((GHIDRA_INT(chainTear) + 0x428)))->_l) & GHIDRA_UINT(g_tearFlagChain._l)) == 0
&& (*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(chainTear) + 0x42c)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagChain._l)) + 0x4)))) == 0) &&
(bVar2 = bVar3,
(*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(chainTear) + 0x430)) & GHIDRA_UINT(g_tearFlagChain._h)) == 0 &&
(*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(chainTear) + 0x434)) & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_tearFlagChain._h)) + 0x4)))) == 0)) break;
isNotSelf = chainTear != self;
chainTear = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(chainTear) + 0x494));
bVar2 = false;
if (isNotSelf) {
bVar2 = bVar3;
}
if ((chainTear == (EntityPtr)0x0) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(chainTear) + 0x28)) != 2)) {
chainTear = (EntityPtr)0x0;
}
bVar3 = bVar2;
} while (bVar2);
if (bVar2) {
LAB_0067aa2a:
partner = *GHIDRA_CAST<Entity_Tear **>((GHIDRA_CAST<char *>(local_30._data) + i * 4));
fVar5 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(self) + 0x340)) - (partner->_pos).y;
dx = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(self) + 0x33c)) - (partner->_pos).x;
fVar5 = sqrtf(fVar5 * fVar5 + dx * dx);
if (fVar5 < nearestDistance) {
tearData = local_30._data;
nearestDistance = fVar5;
nearestTear = partner;
goto LAB_0067aa8b;
}
}
tearData = local_30._data;
partner = nearestTear;
}
}
LAB_0067aa8b:
i = i + 1;
} while (i < GHIDRA_UINT(local_30._size));
}
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_30)) + 0x0))) == '\0') {
if (g_mainHeap == (void *)0x0) {
allocatedBytes = &g_allocatedBytesNoHeap;
}
else {
allocatedBytes = GHIDRA_CAST<qword *>((GHIDRA_INT(g_mainHeap) + 0x30));
}
if (local_30._data != (void *)0x0) {
uVar1 = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(local_30._data) + -4));
qVar4 = *allocatedBytes;
*GHIDRA_CAST<uint *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar1;
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar4) < uVar1));
free(GHIDRA_CAST<uint *>((GHIDRA_INT(local_30._data) + -4)));
}
}
ExceptionList = local_10;
return partner;
}
// 0067aaf0
void Entity_Tear::apply_link_spring_forces()
{
float dist;
float dirY;
float dirX;
float springX;
float springY;
int frameCount;
EntityPtr linkedTear;
float speedMultiplier;
frameCount = g_game->_frameCount;
if (0 < frameCount - this->_spawnFrame) {
linkedTear = this->_linkPrev;
springY = 0.0;
springX = 0.0;
if ((linkedTear != (EntityPtr)0x0) && (0 < frameCount - *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(linkedTear) + 0x328)))) {
dirY = (this->_prevPosition).y - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(linkedTear) + 0x390));
dirX = (this->_prevPosition).x - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(linkedTear) + 0x38c));
dist = sqrtf(dirY * dirY + dirX * dirX);
if (0.0 < dist) {
dirX = dirX * (1.0 / dist);
dirY = dirY * (1.0 / dist);
}
speedMultiplier = this->_speedMultiplier;
springX = (0.0 - ((dist - 10.0) * dirX * 0.3) / speedMultiplier) -
(((this->_prevVelocity).x - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(linkedTear) + 0x394))) * 0.3) /
speedMultiplier;
springY = (0.0 - ((dist - 10.0) * dirY * 0.3) / speedMultiplier) -
(((this->_prevVelocity).y - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(linkedTear) + 0x398))) * 0.3) /
speedMultiplier;
}
linkedTear = this->_linkNext;
if ((linkedTear != (EntityPtr)0x0) && (0 < frameCount - *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(linkedTear) + 0x328)))) {
dirY = (this->_prevPosition).y - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(linkedTear) + 0x390));
dirX = (this->_prevPosition).x - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(linkedTear) + 0x38c));
dist = sqrtf(dirY * dirY + dirX * dirX);
if (0.0 < dist) {
dirY = dirY * (1.0 / dist);
dirX = dirX * (1.0 / dist);
}
speedMultiplier = this->_speedMultiplier;
springX = (springX - ((dist - 10.0) * dirX * 0.3) / speedMultiplier) -
(((this->_prevVelocity).x - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(linkedTear) + 0x394))) * 0.3) /
speedMultiplier;
springY = (springY - ((dist - 10.0) * dirY * 0.3) / speedMultiplier) -
(((this->_prevVelocity).y - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(linkedTear) + 0x398))) * 0.3) /
speedMultiplier;
}
if ((springX != g_vectorZero.x) || (springY != g_vectorZero.y)) {
dist = this->_speedMultiplier;
(this->_velocity).x = springX * dist + (this->_velocity).x;
(this->_velocity).y = dist * springY + (this->_velocity).y;
}
this->_friction = this->_friction * 0.95;
}
return;
}
// 0067d560
undefined1 Entity_Tear::try_make_bridges(float *param_1)
{
GridEntity *rock;
Room *this;
char cVar1;
uint uVar2;
BitSet128 *maskedFlags;
int iVar3;
GridEntity *pit;
Entity *in_ECX;
void *collisionPoints;
int iVar4;
int iVar5;
uint uVar6;
Entity *pEVar7;
float dirX;
float dirY;
EntityRef tearRef;
BitSet128 local_58;
BitSet128 local_48;
BitSet128 local_38;
int *local_28;
int *local_24;
int rockDamage;
void *local_1c;
Entity *local_18;
undefined1 isHitSolid;
char isRockDestroyed;
void *local_10;
undefined1 *puStack_c;
undefined4 local_8;
float velX;
float velY;
code *virtualFn;
local_8 = 0xffffffff;
puStack_c = &LAB_00af7a8d;
local_10 = ExceptionList;
uVar2 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
ExceptionList = &local_10;
local_18 = in_ECX;
maskedFlags = BitSet128::operator_and
(&local_48,GHIDRA_CAST<BitSet128 *>(&in_ECX[1]._pendingDamageFlags),
&g_tearFlagNoGridDamage);
if ((GHIDRA_INT(maskedFlags->_l) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&maskedFlags->_l) + 4)) != 0) ||
(local_28 = GHIDRA_CAST<int *>((GHIDRA_UINT(maskedFlags->_h) | *GHIDRA_CAST<uint *>((GHIDRA_INT(&maskedFlags->_h) + 4)))),
local_28 != GHIDRA_CAST<int *>(0x0))) {
ExceptionList = local_10;
return 0;
}
isHitSolid = 0;
isRockDestroyed = '\0';
rockDamage = (10.0 < in_ECX->_collisionDamage) + 1;
local_24 = local_28;
local_28 = operator_new(0x14);
*local_28 = GHIDRA_INT(local_28);
local_28[1] = GHIDRA_INT(local_28);
local_28[2] = GHIDRA_INT(local_28);
*GHIDRA_CAST<undefined2 *>((local_28 + 3)) = 0x101;
local_8 = 0;
uVar6 = 0;
collisionPoints = (in_ECX->_collisionPoints)._begin;
if (GHIDRA_INT((in_ECX->_collisionPoints)._end) - GHIDRA_INT(collisionPoints) >> 3 != 0) {
do {
local_1c = g_game->_room;
iVar4 = GHIDRA_INT((((*param_1 + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(collisionPoints) + uVar6 * 8))) - 40.0) / 40.0 + 0.5))
;
iVar3 = GHIDRA_INT((((*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(collisionPoints) + uVar6 * 8 + 4)) + param_1[1]) - 120.0) / 40.0
+ 0.5));
if ((((-1 < iVar4) && (iVar4 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_1c) + 0xc)))) && (-1 < iVar3)) &&
((in_ECX = local_18, iVar3 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_1c) + 0x10)) &&
(local_1c = (void *)(iVar3 * *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_1c) + 0xc)) + iVar4), -1 < GHIDRA_INT(local_1c))))
) {
std::set<int>::insert(&local_38._h,&local_1c);
}
uVar6 = uVar6 + 1;
collisionPoints = (in_ECX->_collisionPoints)._begin;
} while (uVar6 < GHIDRA_UINT((GHIDRA_INT((in_ECX->_collisionPoints)._end) - GHIDRA_INT(collisionPoints) >> 3)));
}
param_1 = GHIDRA_CAST<float *>(*local_28);
if (param_1 != GHIDRA_CAST<float *>(local_28)) {
pEVar7 = local_18;
do {
if (((GHIDRA_UINT(param_1[4]) < 0x1c0) &&
(rock = *GHIDRA_CAST<GridEntity **>((GHIDRA_CAST<char *>(g_game->_room) + GHIDRA_INT(param_1[4]) * 4 + 0x24)),
rock != GHIDRA_CAST<GridEntity *>(0x0))) &&
((rock->_collisionClass != 1 &&
((rock->_collisionClass != 0 && (isHitSolid = 1, isRockDestroyed == '\0')))))) {
cVar1 = rock->CanTakeDamageFromTearEffects(uVar2);
if ((cVar1 != '\0') &&
(((maskedFlags = BitSet128::operator_and
(&local_38,GHIDRA_CAST<BitSet128 *>(&pEVar7[1]._pendingDamageFlags),
&g_tearFlagAcid),
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)) ||
(((maskedFlags = BitSet128::operator_and
(&local_58,GHIDRA_CAST<BitSet128 *>(&pEVar7[1]._pendingDamageFlags),
&g_tearFlagRock),
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(),
(float)((double)GHIDRA_INT(uVar6) + __uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)]) *
2.3283064e-10 < pEVar7->_collisionDamage * 0.1)))))) {
virtualFn = *(code **)(*GHIDRA_CAST<int *>(rock) + 0x14);
(GHIDRA_CAST<EntityRef *>((&tearRef)))->EntityRef::constructor(local_18);
cVar1 = (*virtualFn)(0,&tearRef);
if (cVar1 != '\0') {
isRockDestroyed = '\x01';
velX = (local_18->_velocity).x;
velY = (local_18->_velocity).y;
if (ABS(velX) <= ABS(velY)) {
dirX = 0.0;
if (0.0 <= velY) {
dirY = 1.0;
}
else {
dirY = (float)&DAT_bf800000;
}
}
else {
dirY = 0.0;
if (0.0 <= velX) {
dirX = 1.0;
}
else {
dirX = (float)&DAT_bf800000;
}
}
if ((dirX != g_vectorZero.x) || (dirY != g_vectorZero.y)) {
this = g_game->_room;
iVar3 = this->_gridWidth;
iVar5 = GHIDRA_INT(((((float)(rock->_gridIndex % iVar3) * 40.0 + 40.0 + dirX * 40.0) - 40.0)
/ 40.0 + 0.5));
iVar4 = GHIDRA_INT(((((float)(rock->_gridIndex / iVar3) * 40.0 + 120.0 + dirY * 40.0) -
120.0) / 40.0 + 0.5));
if (((-1 < iVar5) &&
(((iVar5 < iVar3 && (-1 < iVar4)) && (iVar4 < this->_gridHeight)))) &&
(iVar5 = iVar3 * iVar4 + iVar5, -1 < iVar5)) {
if (iVar5 < 0x1c0) {
pit = this->_gridEntities[iVar5];
}
else {
pit = GHIDRA_CAST<GridEntity *>(0x0);
}
this->Room::TryMakeBridge(pit,rock);
}
}
}
pEVar7 = local_18;
}
if (isRockDestroyed == '\0') {
virtualFn = *(code **)(*GHIDRA_CAST<int *>(rock) + 0x10);
(GHIDRA_CAST<EntityRef *>((&tearRef)))->EntityRef::constructor(local_18);
(*virtualFn)(rockDamage,&tearRef);
pEVar7 = local_18;
}
}
std::
_Tree_unchecked_const_iterator<std::_Tree_val<std::_Tree_simple_types<unsigned_int>_>,std::_Iterator_base0>
::operator++((_Tree_unchecked_const_iterator<std::_Tree_val<std::_Tree_simple_types<unsigned_int>_>,std::_Iterator_base0>
*)&param_1);
} while (param_1 != GHIDRA_CAST<float *>(local_28));
}
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<std::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
(&local_28,(fuzzer_allocator<std::_Tree_node<unsigned_int,void*>_> *)&local_28,
(_Tree_node<unsigned_int,void*> *)local_28[1]);
operator_delete(local_28,0x14);
ExceptionList = local_10;
return isHitSolid;
}
// 006b5320
void Entity_Tear::reroll_hit_entity(int unused)
{
code *pcVar1;
Game *pGVar2;
longlong lVar3;
longlong lVar4;
char isBanned;
byte isErased;
Vector *foundPos;
Entity *tmpEntity;
uint uVar5;
uint uVar6;
int *piVar7;
int unusedArg;
void *pvVar8;
uint uVar9;
int iVar10;
PlayerManager *playerManager;
bool bVar11;
float dy;
float dx;
ulonglong timeNs;
undefined1 auStack_c4 [4];
uint spawnSubType;
uint local_bc;
int *local_b8;
Vector newPos;
EntityPtr *local_ac;
Entity *local_a8;
Game *local_a4;
uint local_a0;
uint spawnType;
uint spawnVariant;
uint spawnSeed;
int local_90 [3];
Entity_Tear *hitEntity;
int procKeyType;
int procKeyVariant;
Vector freeTilePos [2];
undefined8 rngShifts;
undefined4 local_60;
undefined1 local_5c [8];
int local_54;
Vector randomPos;
ColorMod poofColor;
RNG cardRng;
uint local_c;
EntityPtr *spawnerPtr;
ColorMod *spriteColor;
local_c = __security_cookie ^ GHIDRA_UINT(auStack_c4);
iVar10 = 0x20;
hitEntity = this;
do {
newPos.x = g_vectorZero.x;
newPos.y = g_vectorZero.y;
foundPos = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::GetRandomPosition(&randomPos,0.0);
newPos.x = foundPos->x;
newPos.y = foundPos->y;
foundPos = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::FindFreeTilePosition(freeTilePos,&newPos,0.0);
newPos.x = foundPos->x;
newPos.y = foundPos->y;
dx = newPos.x - (this->_pos).x;
dy = newPos.y - (this->_pos).y;
if ((400.0 < dy * dy + dx * dx) &&
(tmpEntity = Game::GetNearestTargetPlayer(&newPos,GHIDRA_CAST<Entity *>(this),0,0,(void *)0x0,5000.0),
dx = (tmpEntity->_pos).x - newPos.x, dy = (tmpEntity->_pos).y - newPos.y,
6400.0 < dy * dy + dx * dx)) break;
iVar10 = iVar10 + -1;
newPos.x = g_vectorZero.x;
newPos.y = g_vectorZero.y;
} while (-1 < iVar10);
if ((newPos.x == g_vectorZero.x) && (newPos.y == g_vectorZero.y)) {
return;
}
uVar5 = Random();
poofColor._colorize[0] = 0.0;
poofColor._colorize[1] = 0.0;
poofColor._colorize[2] = 0.0;
poofColor._colorize[3] = 0.0;
poofColor._tint[0] = 1.0;
poofColor._tint[1] = 1.0;
poofColor._tint[2] = 1.0;
poofColor._tint[3] = 1.0;
poofColor._offset[0] = 0.2509804;
poofColor._offset[1] = 0.34901962;
poofColor._offset[2] = 0.5019608;
tmpEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0xf,&this->_pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar5,0);
spriteColor = &(tmpEntity->_sprite)._color;
if (spriteColor != &poofColor) {
spriteColor->_tint[0] = 1.0;
(tmpEntity->_sprite)._color._tint[1] = 1.0;
(tmpEntity->_sprite)._color._tint[2] = 1.0;
(tmpEntity->_sprite)._color._tint[3] = 1.0;
(tmpEntity->_sprite)._color._colorize[0] = 0.0;
(tmpEntity->_sprite)._color._colorize[1] = 0.0;
(tmpEntity->_sprite)._color._colorize[2] = 0.0;
(tmpEntity->_sprite)._color._colorize[3] = 0.0;
*GHIDRA_CAST<ulonglong *>((tmpEntity->_sprite)._color._offset) =
CONCAT44(poofColor._offset[1],poofColor._offset[0]);
(tmpEntity->_sprite)._color._offset[2] = poofColor._offset[2];
}
spawnSeed = Random();
local_a4 = g_game;
spawnSubType = 0;
spawnVariant = 0xf;
spawnType = 1000;
lua_callback_run_pre_entity_spawn
(GHIDRA_CAST<int *>(&spawnType),GHIDRA_CAST<int *>(&spawnVariant),&newPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),
GHIDRA_CAST<int *>(&spawnSubType),&spawnSeed);
uVar5 = spawnVariant;
if (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) {
LAB_006b57d9:
local_bc = spawnSubType;
}
else {
piVar7 = (g_game->_deathmatchManager)._type;
local_b8 = piVar7;
uVar6 = Random();
uVar9 = spawnSubType;
rngShifts = 0x900000005;
local_a8 = GHIDRA_CAST<Entity *>(0x7);
local_60 = 7;
if (spawnType != 5) goto LAB_006b57d9;
if (uVar5 < 0x12d) {
if (uVar5 == 300) {
while ((local_bc = spawnSubType, spawnSubType == 0 ||
(isBanned = (**(code **)(*piVar7 + 0x24))(spawnSubType), isBanned != '\0'))) {
if (uVar6 == 0) {
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
pcVar1 = (code *)swi(3);
(*pcVar1)();
return;
}
uVar6 = uVar6 >> ((byte)rngShifts & 0x1f) ^ uVar6;
uVar6 = uVar6 << ((byte)((ulonglong)rngShifts >> 0x20) & 0x1f) ^ uVar6;
uVar6 = uVar6 >> ((byte)local_a8 & 0x1f) ^ uVar6;
iVar10 = ItemPool::GetCardEx(uVar6,0x19,10,10,1);
cardRng._shift1 = 5;
cardRng._shift2 = 9;
cardRng._shift3 = 7;
cardRng._seed = uVar6;
spawnSubType = lua_callback_run_get_card(&cardRng,iVar10,1,1,0);
}
}
else {
if (uVar5 == 0x46) {
local_a0 = spawnSubType >> 0xb;
do {
local_bc = spawnSubType;
if (spawnSubType != 0) {
pcVar1 = *(code **)(*piVar7 + 0x28);
iVar10 = (GHIDRA_CAST<ItemPool *>((&g_game->_itemPool)))->ItemPool::GetPillEffect(spawnSubType,GHIDRA_CAST<Entity_Player *>(0x0))
;
isBanned = (*pcVar1)(iVar10);
if (isBanned == '\0') goto LAB_006b57e1;
piVar7 = local_b8;
}
if (uVar6 == 0) {
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
pcVar1 = (code *)swi(3);
(*pcVar1)();
return;
}
uVar6 = uVar6 >> ((byte)rngShifts & 0x1f) ^ uVar6;
uVar6 = uVar6 << ((byte)((ulonglong)rngShifts >> 0x20) & 0x1f) ^ uVar6;
uVar6 = uVar6 >> ((byte)local_a8 & 0x1f) ^ uVar6;
spawnSubType = ItemPool::GetPill(uVar6);
spawnSubType = spawnSubType | (local_a0 & 1) << 0xb;
} while( true );
}
if (uVar5 != 100) goto LAB_006b57d9;
local_bc = spawnSubType;
if (spawnSubType == 0x19) {
LAB_006b5635:
bVar11 = false;
}
else {
local_a0 = spawnSubType;
std::set<int>::find_node(local_5c,&local_a0);
if (((*GHIDRA_CAST<char *>((local_54 + 0xd)) == '\0') && (*GHIDRA_CAST<int *>((local_54 + 0x10)) <= GHIDRA_INT(uVar9))) &&
(local_54 != piVar7[8])) goto LAB_006b5635;
bVar11 = true;
}
if ((uVar9 == 0) || (bVar11)) {
spawnSubType = (**(code **)(*piVar7 + 0x84))(0);
local_bc = spawnSubType;
}
}
}
else {
if (uVar5 != 0x15e) goto LAB_006b57d9;
while ((local_bc = spawnSubType, spawnSubType == 0 ||
(isBanned = (**(code **)(*piVar7 + 0x2c))(spawnSubType), isBanned != '\0'))) {
spawnSubType = (GHIDRA_CAST<ItemPool *>((&g_game->_itemPool)))->ItemPool::GetTrinket(0);
}
}
}
LAB_006b57e1:
local_a8 = (GHIDRA_CAST<EntityFactory *>((local_a4->_entityFactory)))->EntityFactory::Create(spawnType,0);
if (local_a8 == GHIDRA_CAST<Entity *>(0x0)) goto LAB_006b5ab6;
timeNs = GetTimeNs();
tmpEntity = local_a8;
uVar5 = GHIDRA_UINT((timeNs >> 0x20));
lVar3 = (timeNs & 0xffffffff) * 0x431bde82;
local_ac = GHIDRA_CAST<EntityPtr *>(((ulonglong)lVar3 >> 0x20));
lVar4 = (ulonglong)uVar5 * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20);
local_90[0] = GHIDRA_INT((lVar4 + lVar3));
lVar3 = (ulonglong)uVar5 * 0x431bde82 +
(ulonglong)
CONCAT14(CARRY4(GHIDRA_UINT(((ulonglong)lVar4 >> 0x20)),
GHIDRA_UINT((&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_ac)) + 0x0))) + CARRY4(GHIDRA_UINT(lVar3),GHIDRA_UINT(lVar4))))),
GHIDRA_INT(((ulonglong)(lVar4 + lVar3) >> 0x20)));
local_90[2] = GHIDRA_INT(((ulonglong)lVar3 >> 0x20));
spawnerPtr = &local_a8->_spawnerEntity;
local_b8 = GHIDRA_CAST<int *>((GHIDRA_UINT(lVar3) >> 0x12 | local_90[2] * 0x4000));
local_90[2] = GHIDRA_UINT(local_90[2]) >> 0x12;
local_a8->_spawnerType = 0;
local_a8->_spawnerVariant = 0;
if (*spawnerPtr != (EntityPtr)0x0) {
local_ac = spawnerPtr;
std::multiset<unsigned_int>::erase(&local_ac);
}
iVar10 = *GHIDRA_CAST<int *>(tmpEntity);
*spawnerPtr = (EntityPtr)0x0;
(tmpEntity->_pos).x = newPos.x;
(tmpEntity->_pos).y = newPos.y;
(tmpEntity->_velocity).x = g_vectorZero.x;
(tmpEntity->_velocity).y = g_vectorZero.y;
(**(code **)(iVar10 + 4))(spawnType,spawnVariant,local_bc,spawnSeed);
pGVar2 = local_a4;
pvVar8 = local_a4->_room;
iVar10 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar8) + 0x1214));
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar8) + 0x1214)) = iVar10 + 1;
tmpEntity->_index = iVar10;
(GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>((GHIDRA_INT(pvVar8) + 0x1218)))))->EntityList::AddEntity(tmpEntity);
isErased = Game::ShouldEraseEnemy(tmpEntity);
if (isErased != 0) {
Entity::RemoveWithPoof(tmpEntity,unusedArg);
}
if ((tmpEntity->_exists != 0) &&
((pGVar2->_proceduralItemManager)._proceduralItems._begin !=
(pGVar2->_proceduralItemManager)._proceduralItems._end)) {
procKeyVariant = tmpEntity->_variant;
procKeyType = tmpEntity->_type;
std::map<unsigned_long_long>::find(&local_a4,&procKeyType);
pGVar2 = (pGVar2->_proceduralItemManager)._spawnTriggerTargets._head;
if (local_a4 == pGVar2) {
local_90[0] = tmpEntity->_type;
local_90[1] = 0xffffffff;
piVar7 = GHIDRA_CAST<int *>(std)::map<unsigned_long_long>::find(&local_bc,local_90);
local_a4 = GHIDRA_CAST<Game *>(*piVar7);
if (local_a4 == pGVar2) goto LAB_006b5a32;
}
uVar5 = 0;
playerManager = &g_game->_playerManager;
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) - GHIDRA_INT((playerManager->_playerList)._begin) >>
2 != 0) {
do {
pvVar8 = (playerManager->_playerList)._end;
if (GHIDRA_INT(pvVar8) - GHIDRA_INT((playerManager->_playerList)._begin) >> 2 == 0) {
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
pvVar8 = (playerManager->_playerList)._end;
}
piVar7 = (playerManager->_playerList)._begin;
if (uVar5 < GHIDRA_UINT((GHIDRA_INT(pvVar8) - GHIDRA_INT(piVar7) >> 2))) {
piVar7 = piVar7 + uVar5;
}
trigger_set_dispatch((void *)(*piVar7 + 0x1fc8),6,tmpEntity,&newPos,&g_vectorZero);
uVar5 = uVar5 + 1;
playerManager = &g_game->_playerManager;
} while (uVar5 < GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
GHIDRA_INT((playerManager->_playerList)._begin) >> 2)));
}
}
LAB_006b5a32:
timeNs = GetTimeNs();
uVar9 = GHIDRA_UINT((timeNs >> 0x20));
lVar3 = (timeNs & 0xffffffff) * 0x431bde82;
lVar4 = (ulonglong)uVar9 * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20);
uVar6 = GHIDRA_UINT(((ulonglong)lVar4 >> 0x20));
uVar5 = GHIDRA_INT(((ulonglong)lVar3 >> 0x20)) + GHIDRA_UINT(CARRY4(GHIDRA_UINT(lVar3),GHIDRA_UINT(lVar4)));
lVar3 = (ulonglong)uVar9 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar6,uVar5),uVar6 + uVar5);
uVar6 = GHIDRA_UINT(((ulonglong)lVar3 >> 0x20));
uVar5 = GHIDRA_UINT(lVar3) >> 0x12 | uVar6 * 0x4000;
uVar9 = uVar5 - GHIDRA_INT(local_b8);
bVar11 = CARRY4(GHIDRA_UINT(g_entitySpawnTimeMs),uVar9);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_entitySpawnTimeMs)) + 0x0))) = GHIDRA_UINT(g_entitySpawnTimeMs) + uVar9;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_entitySpawnTimeMs)) + 0x4))) =
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_entitySpawnTimeMs)) + 0x4))) + (((uVar6 >> 0x12) - local_90[2]) - GHIDRA_UINT((uVar5 < local_b8))) +
GHIDRA_UINT(bVar11);
LAB_006b5ab6:
spriteColor = &(local_a8->_sprite)._color;
if (spriteColor != &poofColor) {
(local_a8->_sprite)._color._colorize[0] = 0.0;
(local_a8->_sprite)._color._colorize[1] = 0.0;
(local_a8->_sprite)._color._colorize[2] = 0.0;
(local_a8->_sprite)._color._colorize[3] = 0.0;
(local_a8->_sprite)._color._offset[0] = 0.2509804;
(local_a8->_sprite)._color._offset[1] = 0.34901962;
spriteColor->_tint[0] = 1.0;
(local_a8->_sprite)._color._tint[1] = 1.0;
(local_a8->_sprite)._color._tint[2] = 1.0;
(local_a8->_sprite)._color._tint[3] = 1.0;
(local_a8->_sprite)._color._offset[2] = 0.5019608;
}
(hitEntity->_pos).x = newPos.x;
(hitEntity->_pos).y = newPos.y;
return;
}
// 0085dd60
float10 Entity_Tear::BaseDamage()
{
return (float10)this->_baseDamage;
}
// 0085dd70
void Entity_Tear::SetParentOffset(Vector *offset)
{
(this->_parentOffset).x = offset->x;
(this->_parentOffset).y = offset->y;
return;
}
// 0085dd90
Vector * Entity_Tear::PosDisplacement()
{
return &this->_posDisplacement;
}