Files
isaac-port/generated-src/weapon_umbilical_whip.cpp
T
shweetandClaude Opus 5.5 69a354f843 Curation round 8: the first room plays: Isaac walks and shoots tears
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>
2026-11-20 06:43:01 -05:00

145 lines
6.0 KiB
C++

#include "classes.h"
// 00a0e270
void Weapon_UmbilicalWhip::Fire(Vector *direction, uint8_t isShooting, uint8_t isInterpolated)
{
uint8_t isAxisAligned;
Vector *vecResult;
uint32_t seed;
int *whip;
int *extraout_ECX;
int *unused;
Entity *whipEntity;
float fVar1;
float ownerY;
Entity_Player *local_2c;
Vector VStack_28;
Vector VStack_20;
Vector aimDirection;
Vector scratchVec;
uint32_t flagsHigh;
Manager *manager;
int owner;
Weapon::Fire(this,direction,isShooting,isInterpolated);
local_2c = *GHIDRA_CAST<Entity_Player **>((GHIDRA_CAST<char *>(this) + 4));
if (local_2c == GHIDRA_CAST<Entity_Player *>(0x0)) {
LAB_00a0e2c3:
local_2c = GHIDRA_CAST<Entity_Player *>(0x0);
}
else {
if (local_2c->_type != 1) {
if (local_2c->_type != 3) goto LAB_00a0e2c3;
local_2c = *GHIDRA_CAST<Entity_Player **>(&local_2c->_isControlsEnabled);
if (local_2c == GHIDRA_CAST<Entity_Player *>(0x0)) goto LAB_00a0e2cb;
}
Entity_Player::HasCollectible(local_2c,0x18a,0);
}
LAB_00a0e2cb:
whip = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(this) + 0x44));
owner = 0;
if (whip != GHIDRA_CAST<int *>(0x0)) {
owner = (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(whip) + 0x171)) != '\0') + 1;
}
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x1c)) = owner;
if ((isShooting != 0) &&
(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0xc)) <= 0.0 && *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0xc)) != 0.0)) {
if (isInterpolated != 0) {
return;
}
unused = whip;
if ((whip != GHIDRA_CAST<int *>(0x0)) && (whip[0x362] == 1)) {
(**(code **)(*whip + 0x28))();
whip = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(this) + 0x44));
unused = extraout_ECX;
}
if (whip == GHIDRA_CAST<int *>(0x0)) {
fVar1 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x10));
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0xc)) = fVar1 + fVar1;
Weapon::SetBlinkTime(this,7 - GHIDRA_INT((fVar1 * -0.45)),GHIDRA_INT(unused));
aimDirection.x = direction->x;
aimDirection.y = direction->y;
isAxisAligned = Weapon::IsAxisAligned(this);
if (isAxisAligned == 0) {
(GHIDRA_CAST<Vector *>((&aimDirection)))->Vector::Normalize();
}
else {
vecResult = Vector::ToCardinal(&VStack_20,&aimDirection);
aimDirection.x = vecResult->x;
aimDirection.y = vecResult->y;
}
VStack_28.x = aimDirection.x * 10.0;
VStack_20.x = aimDirection.y * 10.0;
vecResult = Weapon::get_tear_movement_inheritance(this,&scratchVec,&aimDirection);
VStack_28.x = vecResult->x * 0.4 + VStack_28.x;
VStack_28.y = vecResult->y * 0.4 + VStack_20.x;
vecResult = (GHIDRA_CAST<Vector *>((&VStack_28)))->Vector::Normalized(&scratchVec);
aimDirection.x = vecResult->x;
aimDirection.y = vecResult->y;
seed = Random();
vecResult = Weapon::get_owner_position(this,&scratchVec);
VStack_28.x = (float)Game::SpawnEx(g_game,3,0xf0,vecResult,&g_vectorZero,GHIDRA_CAST<Entity *>(local_2c),0,
seed,0);
whipEntity = *GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(this) + 0x44));
whip = GHIDRA_CAST<int *>((GHIDRA_INT(this) + 0x44));
if (whipEntity != GHIDRA_CAST<Entity *>(VStack_28.x)) {
if (whipEntity != GHIDRA_CAST<Entity *>(0x0)) {
VStack_20.x = (float)whip;
msvc::multiset<unsigned_int>::erase(&VStack_20);
}
*whip = GHIDRA_INT(VStack_28.x);
whipEntity = GHIDRA_CAST<Entity *>(0x0);
if (GHIDRA_CAST<Entity *>(VStack_28.x) != GHIDRA_CAST<Entity *>(0x0)) {
msvc::multiset<unsigned_int>::insert(whip);
whipEntity = GHIDRA_CAST<Entity *>(*whip);
}
}
flagsHigh = *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&whipEntity->_flags) + 4));
*GHIDRA_CAST<uint32_t *>(&whipEntity->_flags) = GHIDRA_UINT(whipEntity->_flags) & 0xfffffffb;
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&whipEntity->_flags) + 4)) = flagsHigh;
vecResult = (GHIDRA_CAST<Vector *>((&aimDirection)))->Vector::Normalized(&scratchVec);
fVar1 = vecResult->y;
owner = *whip;
*GHIDRA_CAST<float *>((owner + 0x334)) = vecResult->x;
*GHIDRA_CAST<float *>((owner + 0x338)) = fVar1;
(**(code **)(*GHIDRA_CAST<int *>(*whip) + 0xc))();
manager = g_manager;
local_2c = GHIDRA_CAST<Entity_Player *>(0x1ee);
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_2c));
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_2c),1.0,2,0,1.0,0.0);
Weapon::TriggerTearEffects(this,&aimDirection,1);
whip = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(this) + 0x44));
}
}
if (whip == GHIDRA_CAST<int *>(0x0)) {
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x3c)) = g_vectorZero.x;
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x40)) = g_vectorZero.y;
}
else {
owner = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 4));
if (owner == 0) {
fVar1 = g_vectorZero.x;
ownerY = g_vectorZero.y;
}
else {
fVar1 = *GHIDRA_CAST<float *>((owner + 0x33c));
ownerY = *GHIDRA_CAST<float *>((owner + 0x340));
}
local_2c = GHIDRA_CAST<Entity_Player *>(((float)whip[0xcf] - fVar1));
VStack_28.x = (float)whip[0xd0] - ownerY;
fVar1 = sqrtf((float)local_2c * (float)local_2c + VStack_28.x * VStack_28.x);
if (fVar1 <= 0.0) {
*GHIDRA_CAST<Entity_Player **>((GHIDRA_CAST<char *>(this) + 0x3c)) = local_2c;
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x40)) = VStack_28.x;
}
else {
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x3c)) = (float)local_2c * (1.0 / fVar1);
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x40)) = VStack_28.x * (1.0 / fVar1);
}
}
if ((isShooting == 0) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x44)) != 0)) {
*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x44)) + 0xd88)) = 1;
}
return;
}