Eight agents took over Room::Init's pieces, RailManager, Room::Render/render_lighting/Update, the GridEntity hierarchy (walls, doors, rocks, pits, poop ...), Game::Update and interpolate_update, the run's save, update_ingame_input, Game::Spawn with the entity factory and grid collision, the player's movement and tears through Weapon/Weapon_Tears, PlayerManager's positions, the camera focus, MinimapConfig, PlayerHUD, mod shader rendering, Entity_Tear and Entity_Effect. Integration wrote Level::get_secret_exit_kind, shared the secret-exit enum (four copies merged) and fixed the generator's vtable-stub check (word boundary and namespace, not a substring). Under gdb a run reaches the first room: doors, HUD with hearts and minimap, WASD movement with acceleration, arrow-key tears that fly and splash. Floor and walls (Backdrop::RenderFloor/RenderWalls) and room transitions are next. The official build/isaac reaches the start room and stops at Entity_NPC::Redirect. 2770 functions taken over. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
636 lines
28 KiB
C++
636 lines
28 KiB
C++
#include "classes.h"
|
|
|
|
// 00a06a30
|
|
void Weapon_Ludovico::Fire(Vector *direction, uint8_t isShooting, uint8_t isInterpolated)
|
|
{
|
|
void *orbitTear = this;
|
|
uint32_t *puVar1;
|
|
Entity *pEVar2;
|
|
uint8_t bVar3;
|
|
uint32_t uVar4;
|
|
int iVar5;
|
|
Vector *pVVar6;
|
|
TearParams *hitParams;
|
|
BitSet128 *pBVar7;
|
|
Entity_Tear **ppEVar8;
|
|
Entity_Tear *orbitTear;
|
|
uint32_t rngResult;
|
|
Entity_Player *extraout_ECX;
|
|
Entity_Player *extraout_ECX_00;
|
|
Entity_Player *extraout_ECX_01;
|
|
Entity_Player *extraout_ECX_02;
|
|
Entity_Player *pEVar9;
|
|
Entity_Player *extraout_ECX_03;
|
|
Entity_Player *extraout_ECX_04;
|
|
int extraout_ECX_05;
|
|
int *piVar10;
|
|
Entity_Player *player;
|
|
int *piVar11;
|
|
Entity_Tear *extraout_EDX;
|
|
uint64_t *allocatedBytesPtr;
|
|
Entity_Tear *pEVar12;
|
|
uint8_t *puVar13;
|
|
Weapon *weapon;
|
|
int *piVar14;
|
|
float fVar15;
|
|
float fVar16;
|
|
short multiShotParams [18];
|
|
BitSet128 notExplosiveFlags;
|
|
BitSet128 tearFlagsTmp;
|
|
uint8_t local_16c [8];
|
|
int iStack_164;
|
|
Entity_Tear *pEStack_160;
|
|
uint8_t notExplosiveFlags2 [4];
|
|
Entity_Tear *orbitTearsBegin;
|
|
int *orbitTearsEnd;
|
|
int *orbitTearsCap;
|
|
void *childTearsBegin;
|
|
int *childTearsEnd;
|
|
int *local_144;
|
|
int *childTearsCap;
|
|
uint8_t local_13c [8];
|
|
Vector VStack_134;
|
|
Vector local_12c;
|
|
uint8_t local_124 [8];
|
|
Vector local_11c;
|
|
Entity_Tear *luck;
|
|
float shotSpeed;
|
|
int *local_10c;
|
|
Entity_Player *ownerPlayer;
|
|
Weapon *self;
|
|
Entity_Tear *local_100;
|
|
Vector local_fc;
|
|
Entity_Tear *local_f4;
|
|
Entity_Tear *local_f0;
|
|
int *local_ec;
|
|
Entity_Tear *local_e8;
|
|
TearParams tearParams;
|
|
TearParams hitParamsBuf;
|
|
uint32_t local_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
float local_8;
|
|
uint64_t allocatedBytes;
|
|
Game *game;
|
|
|
|
local_8 = -NAN;
|
|
puStack_c = &LAB_00b10866;
|
|
local_10 = ExceptionList;
|
|
uVar4 = __security_cookie ^ GHIDRA_UINT(((&hitParamsBuf)[1]._tearColor._colorize + 3));
|
|
ExceptionList = &local_10;
|
|
local_f4 = GHIDRA_CAST<Entity_Tear *>(direction);
|
|
self = orbitTear;
|
|
local_14 = uVar4;
|
|
Weapon::Fire(orbitTear,direction,isShooting,isInterpolated);
|
|
pEVar9 = *GHIDRA_CAST<Entity_Player **>((GHIDRA_CAST<char *>(orbitTear) + 4));
|
|
if (pEVar9 == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
LAB_00a06a9a:
|
|
ownerPlayer = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
if (pEVar9 != GHIDRA_CAST<Entity_Player *>(0x0)) goto LAB_00a06aa0;
|
|
local_f0 = GHIDRA_CAST<Entity_Tear *>(g_vectorZero.x);
|
|
local_ec = GHIDRA_CAST<int *>(g_vectorZero.y);
|
|
ownerPlayer = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
LAB_00a06b2b:
|
|
luck = GHIDRA_CAST<Entity_Tear *>(0x0);
|
|
if (pEVar9 != GHIDRA_CAST<Entity_Player *>(0x0)) goto LAB_00a06b3a;
|
|
LAB_00a06b6d:
|
|
shotSpeed = 1.0;
|
|
}
|
|
else {
|
|
if (pEVar9->_type == 1) {
|
|
ownerPlayer = pEVar9;
|
|
}
|
|
else {
|
|
if (pEVar9->_type != 3) goto LAB_00a06a9a;
|
|
ownerPlayer = *GHIDRA_CAST<Entity_Player **>(&pEVar9->_isControlsEnabled);
|
|
}
|
|
LAB_00a06aa0:
|
|
local_f0 = GHIDRA_CAST<Entity_Tear *>((pEVar9->_pos).x);
|
|
local_ec = GHIDRA_CAST<int *>((pEVar9->_pos).y);
|
|
if (pEVar9->_type == 1) {
|
|
player = pEVar9;
|
|
}
|
|
else if ((pEVar9->_type != 3) ||
|
|
(player = *GHIDRA_CAST<Entity_Player **>(&pEVar9->_isControlsEnabled), player == GHIDRA_CAST<Entity_Player *>(0x0)
|
|
)) goto LAB_00a06b2b;
|
|
luck = GHIDRA_CAST<Entity_Tear *>(player->_luck);
|
|
LAB_00a06b3a:
|
|
if ((pEVar9->_type != 1) &&
|
|
((pEVar9->_type != 3 ||
|
|
(pEVar9 = *GHIDRA_CAST<Entity_Player **>(&pEVar9->_isControlsEnabled), pEVar9 == GHIDRA_CAST<Entity_Player *>(0x0)))))
|
|
goto LAB_00a06b6d;
|
|
shotSpeed = pEVar9->_shotspeed;
|
|
}
|
|
player = ownerPlayer;
|
|
local_12c.y = (float)(GHIDRA_INT(orbitTear) + 0x44);
|
|
piVar14 = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(orbitTear) + 0x44));
|
|
local_10c = piVar14;
|
|
if ((piVar14 == GHIDRA_CAST<int *>(0x0)) || (piVar14[10] != 2)) {
|
|
if (isInterpolated != 0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if (piVar14 != GHIDRA_CAST<int *>(0x0)) {
|
|
(**(code **)(*piVar14 + 0x28))(uVar4);
|
|
}
|
|
TearParams::constructor(&tearParams);
|
|
weapon = self;
|
|
if (player != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
pEVar2 = *GHIDRA_CAST<Entity **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((self)) + 0x4))));
|
|
if ((pEVar2 == GHIDRA_CAST<Entity *>(0x0)) || (pEVar2->_type != 1)) {
|
|
iVar5 = 0;
|
|
}
|
|
else {
|
|
iVar5 = GHIDRA_INT(*GHIDRA_CAST<char *>((pEVar2[5]._sprite._championColor._tint + 3)));
|
|
}
|
|
hitParams = Entity_Player::GetTearHitParams(player,&hitParamsBuf,8,1.0,iVar5,pEVar2);
|
|
TearParams::operator_(&tearParams,hitParams);
|
|
}
|
|
uVar4 = Random();
|
|
local_11c.x = (float)local_f0 + 0.0;
|
|
local_11c.y = (float)local_ec + 5.0;
|
|
orbitTear = (Entity_Tear *)
|
|
Game::Spawn(g_game,2,tearParams._tearVariant,&local_11c,&g_vectorZero,
|
|
*GHIDRA_CAST<Entity **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((weapon)) + 0x4)))),0,uVar4);
|
|
if ((orbitTear == GHIDRA_CAST<Entity_Tear *>(0x0)) || (orbitTear->_type != 2)) {
|
|
orbitTear = GHIDRA_CAST<Entity_Tear *>(0x0);
|
|
}
|
|
VStack_134.y = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((weapon)) + 0x4))));
|
|
puVar1 = &orbitTear->_parent;
|
|
if (*puVar1 != 0) {
|
|
local_fc.y = (float)puVar1;
|
|
msvc::multiset<unsigned_int>::erase(&local_fc.y);
|
|
}
|
|
*puVar1 = VStack_134.y;
|
|
if (VStack_134.y != 0.0) {
|
|
msvc::multiset<unsigned_int>::insert(puVar1);
|
|
}
|
|
orbitTear->_height = -40.0;
|
|
fVar15 = Entity_Tear::get_height_offset_y(orbitTear,-40.0);
|
|
game = g_game;
|
|
(orbitTear->_posOffset).y = fVar15;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 8)) == 0x10) {
|
|
(orbitTear->_posOffset).y = -18.0;
|
|
}
|
|
(**(code **)(*GHIDRA_CAST<int *>(orbitTear) + 0x40))(tearParams._tearDamage);
|
|
pBVar7 = BitSet128::operator_or(&tearFlagsTmp,&tearParams._flags,&g_tearFlagLudovico);
|
|
Entity_Tear::SetTearFlags(orbitTear,*pBVar7);
|
|
(**(code **)(*GHIDRA_CAST<int *>(orbitTear) + 0x3c))(&tearParams._tearColor,0xffffffff,0xff,0,1);
|
|
fVar15 = sqrtf(tearParams._tearDamage);
|
|
fVar15 = fVar15 * 0.15 + tearParams._tearDamage * 0.04 + 1.5;
|
|
if (fVar15 <= 0.01) {
|
|
fVar15 = 0.01;
|
|
}
|
|
orbitTear->_baseScale = fVar15;
|
|
orbitTear->_fScale = fVar15;
|
|
Entity_Tear::ResetSpriteScale(orbitTear);
|
|
(**(code **)(*GHIDRA_CAST<int *>(orbitTear) + 0xc))();
|
|
fVar15 = local_12c.y;
|
|
if (*GHIDRA_CAST<Entity_Tear **>(local_12c.y) == orbitTear) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if (*GHIDRA_CAST<Entity_Tear **>(local_12c.y) != GHIDRA_CAST<Entity_Tear *>(0x0)) {
|
|
local_fc.y = local_12c.y;
|
|
msvc::multiset<unsigned_int>::erase(&local_fc.y);
|
|
}
|
|
*GHIDRA_CAST<Entity_Tear **>(fVar15) = orbitTear;
|
|
msvc::multiset<unsigned_int>::insert(fVar15);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if (isInterpolated != 0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if (isShooting != 0) {
|
|
local_fc.x = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_f4)) + 0x0))));
|
|
local_100 = *GHIDRA_CAST<Entity_Tear **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_f4)) + 0x4))));
|
|
local_fc.y = (float)local_100;
|
|
local_e8 = GHIDRA_CAST<Entity_Tear *>(local_fc.x);
|
|
if (1.0 < local_fc.x * local_fc.x + (float)local_100 * (float)local_100) {
|
|
(GHIDRA_CAST<Vector *>((&local_fc)))->Vector::Normalize();
|
|
local_e8 = GHIDRA_CAST<Entity_Tear *>(local_fc.x);
|
|
pEVar9 = extraout_ECX;
|
|
}
|
|
local_100 = GHIDRA_CAST<Entity_Tear *>(local_fc.y);
|
|
local_fc.x = (float)local_e8;
|
|
if (player != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
bVar3 = Entity_Player::HasCollectible(player,0x166,0);
|
|
pEVar9 = extraout_ECX_00;
|
|
if (bVar3 != 0) {
|
|
bVar3 = Entity_Player::HasCollectible(player,0xf5,0);
|
|
pEVar9 = extraout_ECX_01;
|
|
if (bVar3 == 0) {
|
|
local_f0 = GHIDRA_CAST<Entity_Tear *>(cos(0.7853982));
|
|
fVar15 = sin(0.7853982);
|
|
fVar16 = (float)local_e8 * fVar15;
|
|
local_e8 = GHIDRA_CAST<Entity_Tear *>(((float)local_e8 * (float)local_f0 - fVar15 * (float)local_100));
|
|
local_100 = GHIDRA_CAST<Entity_Tear *>(((float)local_f0 * (float)local_100 + fVar16));
|
|
pEVar9 = extraout_ECX_02;
|
|
}
|
|
}
|
|
}
|
|
fVar15 = (float)piVar14[0xdb];
|
|
if (fVar15 != 0.0) {
|
|
piVar14[0xd9] =
|
|
GHIDRA_INT((((float)piVar14[0xe7] * (float)local_100 * shotSpeed * 3.0) / fVar15 +
|
|
(float)piVar14[0xd9]));
|
|
piVar14[0xd8] =
|
|
GHIDRA_INT((((float)piVar14[0xe7] * (float)local_e8 * shotSpeed * 3.0) / fVar15 +
|
|
(float)piVar14[0xd8]));
|
|
}
|
|
}
|
|
weapon = self;
|
|
if (*GHIDRA_CAST<Entity **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((self)) + 0x4)))) != GHIDRA_CAST<Entity *>(0x0)) {
|
|
iVar5 = Entity::GetIntervalTicks(*GHIDRA_CAST<Entity **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((self)) + 0x4)))),*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((self)) + 0x10)))),0.0);
|
|
pEVar9 = extraout_ECX_03;
|
|
if (iVar5 != 0) {
|
|
iVar5 = *GHIDRA_CAST<int *>((weapon + 1));
|
|
if (iVar5 == 0) {
|
|
LAB_00a06df7:
|
|
pVVar6 = MusicManager::RandomVector(&local_fc);
|
|
}
|
|
else {
|
|
VStack_134.x = *GHIDRA_CAST<float *>((iVar5 + 0x33c));
|
|
VStack_134.y = *GHIDRA_CAST<float *>((iVar5 + 0x340));
|
|
local_fc.x = *GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((weapon)) + 0x4)))) + 0x33c));
|
|
local_fc.y = *GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((weapon)) + 0x4)))) + 0x340));
|
|
bVar3 = (GHIDRA_CAST<Vector *>((&VStack_134)))->Vector::operator_ne(&local_fc);
|
|
if (bVar3 == 0) goto LAB_00a06df7;
|
|
local_fc.x = *GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>((weapon + 1)) + 0x33c)) -
|
|
*GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((weapon)) + 0x4)))) + 0x33c));
|
|
local_fc.y = *GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>((weapon + 1)) + 0x340)) -
|
|
*GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((weapon)) + 0x4)))) + 0x340));
|
|
pVVar6 = (GHIDRA_CAST<Vector *>((&local_fc)))->Vector::Normalized(&local_11c);
|
|
}
|
|
Weapon::TriggerTearEffects(weapon,pVVar6,1);
|
|
pEVar9 = extraout_ECX_04;
|
|
}
|
|
}
|
|
Weapon::GetMultiShotParams(weapon,multiShotParams,GHIDRA_INT(pEVar9));
|
|
local_e8 = GHIDRA_CAST<Entity_Tear *>((multiShotParams[0] + -1));
|
|
local_100 = (void *)0x0;
|
|
childTearsBegin = (void *)0x0;
|
|
if (GHIDRA_INT(local_e8) < 0) {
|
|
local_e8 = GHIDRA_CAST<Entity_Tear *>(0x0);
|
|
}
|
|
piVar11 = GHIDRA_CAST<int *>(0x0);
|
|
local_ec = GHIDRA_CAST<int *>(0x0);
|
|
childTearsEnd = GHIDRA_CAST<int *>(0x0);
|
|
childTearsCap = GHIDRA_CAST<int *>(0x0);
|
|
local_144 = GHIDRA_CAST<int *>(0x0);
|
|
local_8 = 0.0;
|
|
local_f4 = GHIDRA_CAST<Entity_Tear *>(piVar14[0xf0]);
|
|
if (local_f4 != GHIDRA_CAST<Entity_Tear *>(0x0)) {
|
|
do {
|
|
if (childTearsEnd == piVar11) {
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate(childTearsEnd,&local_f4);
|
|
piVar11 = local_144;
|
|
}
|
|
else {
|
|
*childTearsEnd = GHIDRA_INT(local_f4);
|
|
childTearsEnd = childTearsEnd + 1;
|
|
}
|
|
local_f4 = GHIDRA_CAST<Entity_Tear *>(local_f4->_child);
|
|
} while (local_f4 != GHIDRA_CAST<Entity_Tear *>(0x0));
|
|
local_100 = childTearsBegin;
|
|
childTearsCap = piVar11;
|
|
local_ec = childTearsEnd;
|
|
}
|
|
piVar11 = local_ec;
|
|
orbitTear = local_100;
|
|
local_f4 = GHIDRA_CAST<Entity_Tear *>((GHIDRA_INT(local_ec) - GHIDRA_INT(local_100) >> 2));
|
|
childTearsBegin = local_100;
|
|
childTearsEnd = local_ec;
|
|
if (local_f4 < local_e8) {
|
|
TearParams::constructor(&tearParams);
|
|
orbitTear = extraout_EDX;
|
|
if (ownerPlayer != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
iVar5 = FUN_009f57f0();
|
|
hitParams = Entity_Player::GetTearHitParams
|
|
(ownerPlayer,&hitParamsBuf,8,1.0,iVar5,*GHIDRA_CAST<Entity **>((extraout_ECX_05 + 4))
|
|
);
|
|
TearParams::operator_(&tearParams,hitParams);
|
|
orbitTear = local_e8;
|
|
}
|
|
local_e8 = GHIDRA_CAST<Entity_Tear *>((GHIDRA_INT(orbitTear) - GHIDRA_INT(local_f4)));
|
|
if (0 < GHIDRA_INT(local_e8)) {
|
|
local_ec = piVar14 + 0x3c;
|
|
local_f4 = GHIDRA_CAST<Entity_Tear *>(0x3c23d70a);
|
|
do {
|
|
uVar4 = Random();
|
|
local_fc.x = (float)piVar14[0xcf] + 0.0;
|
|
local_fc.y = (float)piVar14[0xd0] + 5.0;
|
|
orbitTear = (Entity_Tear *)
|
|
Game::Spawn(g_game,2,tearParams._tearVariant,&local_fc,&g_vectorZero,
|
|
*GHIDRA_CAST<Entity **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((self)) + 0x4)))),4,uVar4);
|
|
if ((orbitTear == GHIDRA_CAST<Entity_Tear *>(0x0)) || (orbitTear->_type != 2)) {
|
|
orbitTear = GHIDRA_CAST<Entity_Tear *>(0x0);
|
|
}
|
|
if (orbitTear->_parent != 0) {
|
|
local_f0 = GHIDRA_CAST<Entity_Tear *>(&orbitTear->_parent);
|
|
msvc::multiset<unsigned_int>::erase(&local_f0);
|
|
}
|
|
orbitTear->_parent = local_10c;
|
|
msvc::multiset<unsigned_int>::insert(&orbitTear->_parent);
|
|
orbitTear->_height = -40.0;
|
|
fVar15 = Entity_Tear::get_height_offset_y(orbitTear,-40.0);
|
|
game = g_game;
|
|
(orbitTear->_posOffset).y = fVar15;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 8)) == 0x10) {
|
|
(orbitTear->_posOffset).y = -18.0;
|
|
}
|
|
(**(code **)(*GHIDRA_CAST<int *>(orbitTear) + 0x40))(local_10c[0xe2]);
|
|
pBVar7 = (GHIDRA_CAST<BitSet128 *>((&g_tearFlagExplosive)))->BitSet128::__bnot(GHIDRA_CAST<BitSet128 *>(notExplosiveFlags2));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_16c)) + 0x0))) = local_10c[0x10a];
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_16c)) + 0x4))) = local_10c[0x10b];
|
|
iStack_164 = local_10c[0x10c];
|
|
pEStack_160 = GHIDRA_CAST<Entity_Tear *>(local_10c[0x10d]);
|
|
pBVar7 = BitSet128::operator_and(GHIDRA_CAST<BitSet128 *>(local_124),GHIDRA_CAST<BitSet128 *>(local_16c),pBVar7);
|
|
Entity_Tear::SetTearFlags(orbitTear,*pBVar7);
|
|
(**(code **)(*GHIDRA_CAST<int *>(orbitTear) + 0x3c))(local_ec,0xffffffff,0xff,0,1);
|
|
local_f0 = GHIDRA_CAST<Entity_Tear *>(((float)local_10c[0x108] * 0.5));
|
|
ppEVar8 = &local_f0;
|
|
if ((float)local_10c[0x108] * 0.5 <= 0.01) {
|
|
ppEVar8 = &local_f4;
|
|
}
|
|
pEVar12 = *ppEVar8;
|
|
orbitTear->_baseScale = (float)pEVar12;
|
|
orbitTear->_fScale = (float)pEVar12;
|
|
Entity_Tear::ResetSpriteScale(orbitTear);
|
|
orbitTear->_entityGridCollisionClass = 0;
|
|
local_f0 = orbitTear;
|
|
if (piVar11 == childTearsCap) {
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate(piVar11,&local_f0);
|
|
childTearsCap = local_144;
|
|
}
|
|
else {
|
|
*piVar11 = GHIDRA_INT(orbitTear);
|
|
childTearsEnd = piVar11 + 1;
|
|
}
|
|
local_e8 = GHIDRA_CAST<Entity_Tear *>((GHIDRA_INT(local_e8) + -1));
|
|
piVar11 = childTearsEnd;
|
|
piVar14 = local_10c;
|
|
} while (local_e8 != GHIDRA_CAST<Entity_Tear *>(0x0));
|
|
local_100 = childTearsBegin;
|
|
}
|
|
LAB_00a07202:
|
|
puVar13 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(piVar11) - GHIDRA_INT(local_100) >> 2));
|
|
local_e8 = GHIDRA_CAST<Entity_Tear *>(0x0);
|
|
orbitTear = local_100;
|
|
piVar11 = piVar14;
|
|
if (puVar13 != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
do {
|
|
local_ec = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(orbitTear) + GHIDRA_INT(local_e8) * 4));
|
|
local_f0 = GHIDRA_CAST<Entity_Tear *>((piVar11 + 0xf0));
|
|
if (*GHIDRA_CAST<int *>(local_f0) != 0) {
|
|
local_12c.y = (float)local_f0;
|
|
msvc::multiset<unsigned_int>::erase(&local_12c.y);
|
|
orbitTear = local_100;
|
|
}
|
|
*GHIDRA_CAST<int **>(local_f0) = local_ec;
|
|
if (local_ec != GHIDRA_CAST<int *>(0x0)) {
|
|
msvc::multiset<unsigned_int>::insert(local_f0);
|
|
orbitTear = local_100;
|
|
}
|
|
piVar11 = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(orbitTear) + GHIDRA_INT(local_e8) * 4));
|
|
if (g_game->_frameCount == piVar11[0xca]) {
|
|
(**(code **)(*piVar11 + 0xc))();
|
|
piVar11 = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(local_100) + GHIDRA_INT(local_e8) * 4));
|
|
orbitTear = local_100;
|
|
}
|
|
local_e8 = GHIDRA_CAST<Entity_Tear *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_e8)) + 0x1))));
|
|
} while (local_e8 < puVar13);
|
|
}
|
|
}
|
|
else if (local_e8 < local_f4) {
|
|
pEVar12 = local_e8;
|
|
do {
|
|
local_f0 = luck;
|
|
(**(code **)(**GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(orbitTear) + GHIDRA_INT(pEVar12) * 4)) + 0x28))();
|
|
pEVar12 = GHIDRA_CAST<Entity_Tear *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pEVar12)) + 0x1))));
|
|
} while (pEVar12 < local_f4);
|
|
luck = local_f0;
|
|
piVar10 = GHIDRA_CAST<int *>((GHIDRA_INT(orbitTear) + GHIDRA_INT(local_e8) * 4));
|
|
piVar11 = local_ec;
|
|
piVar14 = local_10c;
|
|
if (piVar10 != local_ec) {
|
|
piVar11 = piVar10;
|
|
childTearsEnd = piVar10;
|
|
}
|
|
goto LAB_00a07202;
|
|
}
|
|
pEVar9 = ownerPlayer;
|
|
if (ownerPlayer != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
bVar3 = Entity_Player::HasCollectible(ownerPlayer,0xe5,0);
|
|
if (bVar3 != 0) {
|
|
piVar11 = GHIDRA_CAST<int *>(0x0);
|
|
local_f0 = GHIDRA_CAST<Entity_Tear *>(0x0);
|
|
orbitTearsBegin = GHIDRA_CAST<Entity_Tear *>(0x0);
|
|
orbitTearsEnd = GHIDRA_CAST<int *>(0x0);
|
|
local_ec = GHIDRA_CAST<int *>(0x0);
|
|
orbitTearsCap = GHIDRA_CAST<int *>(0x0);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
|
|
EntityList::QuerySublist
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),GHIDRA_CAST<EntityList_EL *>(local_16c),2,-1,5,0,0);
|
|
local_8 = (float)CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),2);
|
|
local_e8 = pEStack_160;
|
|
if (pEStack_160 == GHIDRA_CAST<Entity_Tear *>(0x0)) {
|
|
orbitTear = GHIDRA_CAST<Entity_Tear *>(0x0);
|
|
}
|
|
else {
|
|
piVar10 = GHIDRA_CAST<int *>(0x0);
|
|
local_f4 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<Entity_Tear *>(local_16c))) + 0x4)));
|
|
do {
|
|
if (*GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>(local_f4) + 0x3bc)) == piVar14) {
|
|
if (piVar11 == piVar10) {
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate(piVar11,local_f4);
|
|
local_ec = orbitTearsCap;
|
|
piVar10 = orbitTearsCap;
|
|
piVar11 = orbitTearsEnd;
|
|
}
|
|
else {
|
|
*piVar11 = *GHIDRA_CAST<int *>(local_f4);
|
|
orbitTearsEnd = piVar11 + 1;
|
|
piVar11 = orbitTearsEnd;
|
|
}
|
|
}
|
|
local_f4 = GHIDRA_CAST<Entity_Tear *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_f4)) + 0x4))));
|
|
local_e8 = GHIDRA_CAST<Entity_Tear *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_e8[-1])) + 0x847))));
|
|
} while (local_e8 != GHIDRA_CAST<Entity_Tear *>(0x0));
|
|
local_f0 = orbitTearsBegin;
|
|
local_e8 = GHIDRA_CAST<Entity_Tear *>(0x0);
|
|
orbitTear = orbitTearsBegin;
|
|
}
|
|
weapon = self;
|
|
if (GHIDRA_INT(piVar11) - GHIDRA_INT(orbitTear) < 4) {
|
|
pEVar2 = *GHIDRA_CAST<Entity **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((self)) + 0x4))));
|
|
if ((pEVar2 == GHIDRA_CAST<Entity *>(0x0)) || (pEVar2->_type != 1)) {
|
|
iVar5 = 0;
|
|
}
|
|
else {
|
|
iVar5 = GHIDRA_INT(*GHIDRA_CAST<char *>((pEVar2[5]._sprite._championColor._tint + 3)));
|
|
}
|
|
Entity_Player::GetTearHitParams(ownerPlayer,&tearParams,8,1.0,iVar5,pEVar2);
|
|
local_fc.y = 0.01;
|
|
local_10c = GHIDRA_CAST<int *>(&DAT_00000005);
|
|
do {
|
|
uVar4 = Random();
|
|
fVar15 = (float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
local_12c.y = fVar15 + fVar15;
|
|
VStack_134.y = sin(local_12c.y);
|
|
uVar4 = Random();
|
|
local_e8 = (Entity_Tear *)
|
|
((float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283064e-10 * 20.0 + 5.0);
|
|
fVar15 = cos(local_12c.y);
|
|
local_f4 = GHIDRA_CAST<Entity_Tear *>((fVar15 * (float)local_e8));
|
|
local_e8 = GHIDRA_CAST<Entity_Tear *>(((float)local_e8 * VStack_134.y));
|
|
uVar4 = Random();
|
|
local_11c.x = (float)local_f4 + (float)piVar14[0xcf];
|
|
local_11c.y = (float)local_e8 + (float)piVar14[0xd0];
|
|
orbitTear = (Entity_Tear *)
|
|
Game::Spawn(g_game,2,tearParams._tearVariant,&local_11c,&g_vectorZero,
|
|
*GHIDRA_CAST<Entity **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((weapon)) + 0x4)))),5,uVar4);
|
|
if ((orbitTear == GHIDRA_CAST<Entity_Tear *>(0x0)) || (orbitTear->_type != 2)) {
|
|
orbitTear = GHIDRA_CAST<Entity_Tear *>(0x0);
|
|
}
|
|
(orbitTear->_parentOffset).x = (float)local_f4;
|
|
(orbitTear->_parentOffset).y = (float)local_e8;
|
|
if (orbitTear->_parent != 0) {
|
|
VStack_134.y = (float)&orbitTear->_parent;
|
|
msvc::multiset<unsigned_int>::erase(&VStack_134.y);
|
|
}
|
|
orbitTear->_parent = piVar14;
|
|
msvc::multiset<unsigned_int>::insert(&orbitTear->_parent);
|
|
orbitTear->_height = -40.0;
|
|
fVar15 = Entity_Tear::get_height_offset_y(orbitTear,-40.0);
|
|
game = g_game;
|
|
(orbitTear->_posOffset).y = fVar15;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 8)) == 0x10) {
|
|
(orbitTear->_posOffset).y = -18.0;
|
|
}
|
|
(**(code **)(*GHIDRA_CAST<int *>(orbitTear) + 0x40))(piVar14[0xe2]);
|
|
pBVar7 = (GHIDRA_CAST<BitSet128 *>((&g_tearFlagExplosive)))->BitSet128::__bnot(¬ExplosiveFlags);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_13c)) + 0x0))) = piVar14[0x10a];
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_13c)) + 0x4))) = piVar14[0x10b];
|
|
VStack_134.x = (float)piVar14[0x10c];
|
|
VStack_134.y = (float)piVar14[0x10d];
|
|
pBVar7 = BitSet128::operator_and(&tearFlagsTmp,GHIDRA_CAST<BitSet128 *>(local_13c),pBVar7);
|
|
Entity_Tear::SetTearFlags(orbitTear,*pBVar7);
|
|
(**(code **)(*GHIDRA_CAST<int *>(orbitTear) + 0x3c))(piVar14 + 0x3c,0xffffffff,0xff,0,1);
|
|
uVar4 = Random();
|
|
VStack_134.y = ((float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]
|
|
) * 2.3283064e-10 * 0.75 + 0.5) * (float)piVar14[0x108];
|
|
pVVar6 = &VStack_134;
|
|
if (VStack_134.y <= 0.01) {
|
|
pVVar6 = &local_fc;
|
|
}
|
|
fVar15 = pVVar6->y;
|
|
orbitTear->_baseScale = fVar15;
|
|
orbitTear->_fScale = fVar15;
|
|
Entity_Tear::ResetSpriteScale(orbitTear);
|
|
local_10c = GHIDRA_CAST<int *>((GHIDRA_INT(local_10c) + -1));
|
|
orbitTear->_entityGridCollisionClass = 0;
|
|
weapon = self;
|
|
} while (local_10c != GHIDRA_CAST<int *>(0x0));
|
|
}
|
|
if (local_16c[0] == '\0') {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocatedBytesPtr = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocatedBytesPtr = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<Entity_Tear *>(local_16c))) + 0x4))) != GHIDRA_CAST<Entity_Tear *>(0x0)) {
|
|
uVar4 = *GHIDRA_CAST<uint32_t *>(&(GHIDRA_CAST<Entity_Tear *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_16c)) + 0x4)))(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(( + -0x848))))) + 0x844))));
|
|
allocatedBytes = *allocatedBytesPtr;
|
|
*GHIDRA_CAST<uint32_t *>(allocatedBytesPtr) = GHIDRA_UINT(*allocatedBytesPtr) - uVar4;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytesPtr) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytesPtr) + 4)) - GHIDRA_UINT((GHIDRA_UINT(allocatedBytes) < uVar4));
|
|
free(&(GHIDRA_CAST<Entity_Tear *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_16c)) + 0x4)))(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(( + -0x848))))) + 0x844))));
|
|
}
|
|
}
|
|
local_8 = (float)(GHIDRA_UINT(local_8) & 0xffffff00);
|
|
if (local_f0 != GHIDRA_CAST<Entity_Tear *>(0x0)) {
|
|
uVar4 = GHIDRA_INT(local_ec) - GHIDRA_INT(local_f0) & 0xfffffffc;
|
|
orbitTear = local_f0;
|
|
if (0xfff < uVar4) {
|
|
orbitTear = *GHIDRA_CAST<Entity_Tear **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_f0[-1])) + 0x844))));
|
|
uVar4 = uVar4 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(local_f0) + (-4 - GHIDRA_INT(orbitTear))))) goto LAB_00a07ae8;
|
|
}
|
|
operator_delete(orbitTear,uVar4);
|
|
}
|
|
pEVar9 = ownerPlayer;
|
|
}
|
|
iVar5 = Entity::GetIntervalTicks(GHIDRA_CAST<Entity *>(pEVar9),*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((self)) + 0x10)))),0.0);
|
|
if (iVar5 != 0) {
|
|
iVar5 = 0xa07781;
|
|
bVar3 = Entity_Player::HasCollectible(pEVar9,0x57,0);
|
|
if ((bVar3 != 0) &&
|
|
((local_fc.y = (float)__ftoui3(), GHIDRA_CAST<Entity_Tear *>(local_fc.y) == GHIDRA_CAST<Entity_Tear *>(0x0) ||
|
|
(uVar4 = Random(), uVar4 % GHIDRA_UINT(local_fc.y) == 0)))) {
|
|
local_11c.x = shotSpeed * 10.0;
|
|
VStack_134.x = (float)piVar14[0xcf];
|
|
VStack_134.y = (float)piVar14[0xd0];
|
|
local_11c.y = shotSpeed * 0.0;
|
|
local_fc.y = local_11c.x;
|
|
local_ec = GHIDRA_CAST<int *>(local_11c.y);
|
|
Weapon::fire_tear(self,&VStack_134,&local_11c,6,iVar5,1.0,0.0);
|
|
VStack_134.y = shotSpeed * -10.0;
|
|
local_12c.x = (float)piVar14[0xcf];
|
|
local_12c.y = (float)piVar14[0xd0];
|
|
local_11c.y = (float)local_ec;
|
|
local_11c.x = VStack_134.y;
|
|
Weapon::fire_tear(self,&local_12c,&local_11c,6,iVar5,1.0,0.0);
|
|
local_fc.x = (float)piVar14[0xcf];
|
|
local_11c.x = (float)local_ec;
|
|
local_11c.y = local_fc.y;
|
|
local_fc.y = (float)piVar14[0xd0];
|
|
Weapon::fire_tear(self,&local_fc,&local_11c,6,iVar5,1.0,0.0);
|
|
local_fc.x = (float)piVar14[0xcf];
|
|
local_fc.y = (float)piVar14[0xd0];
|
|
local_11c.x = (float)local_ec;
|
|
local_11c.y = VStack_134.y;
|
|
Weapon::fire_tear(self,&local_fc,&local_11c,6,iVar5,1.0,0.0);
|
|
}
|
|
iVar5 = 0xa079a4;
|
|
bVar3 = Entity_Player::HasCollectible(pEVar9,0x37,0);
|
|
if ((bVar3 != 0) &&
|
|
((uVar4 = __ftoui3(), uVar4 == 0 || (rngResult = Random(), rngResult % uVar4 == 0)))) {
|
|
uVar4 = Random();
|
|
shotSpeed = shotSpeed * 10.0;
|
|
fVar15 = (float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
local_fc.y = fVar15 + fVar15;
|
|
fVar15 = cos(local_fc.y);
|
|
local_11c.x = fVar15 * shotSpeed;
|
|
fVar15 = sin(local_fc.y);
|
|
VStack_134.x = (float)piVar14[0xcf];
|
|
local_11c.y = fVar15 * shotSpeed;
|
|
VStack_134.y = (float)piVar14[0xd0];
|
|
Weapon::fire_tear(self,&VStack_134,&local_11c,6,iVar5,1.0,0.0);
|
|
}
|
|
}
|
|
}
|
|
if (local_100 != (void *)0x0) {
|
|
uVar4 = GHIDRA_INT(childTearsCap) - GHIDRA_INT(local_100) & 0xfffffffc;
|
|
orbitTear = local_100;
|
|
if (0xfff < uVar4) {
|
|
orbitTear = *GHIDRA_CAST<Entity_Tear **>((GHIDRA_CAST<char *>(local_100) + -4));
|
|
uVar4 = uVar4 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(local_100) + (-4 - GHIDRA_INT(orbitTear))))) {
|
|
LAB_00a07ae8:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(orbitTear,uVar4);
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|