Curation round 7: Game::Start, level generation, Room, Camera, the Entity hierarchy, Entity_Player, the run frame
Six agents took over Game::Start, Level::SetNextStage, BossPool, save_game_state, level generation to the first room (place_special_rooms, RoomDescriptor, load_room), Room, Camera, Entity/EntityList/EntityRef with a curated skeleton of every Entity_* subclass, Entity_Player, Game::Render, Manager::Update's run branch, RoomTransition, ItemInfoHUD and StatHUD. Integration wrote FirstTrinketOwner and room_shape_get_door_grid_index (checked against the decompile for every shape and slot) and folded the duplicated constants. A run now generates its floor, loads the start room and draws the HUD (under gdb); Isaac renders correctly when drawn, the room itself waits for Room::Render. 2479 functions taken over. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
addd027977
commit
b85591bdf4
146 files changed
+20124
-200863
No files matched your search
@@ -104,7 +104,7 @@ uint8_t PathFinder::is_entity_friendly()
|
||||
if (((*GHIDRA_CAST<uint32_t *>((iVar1 + 0x168)) & 0x100) == 0) &&
|
||||
(entityType = *GHIDRA_CAST<int *>((iVar1 + 0x28)), entityType != 0x322)) {
|
||||
if ((*GHIDRA_CAST<Entity **>((iVar1 + 0x3c4)) != GHIDRA_CAST<Entity *>(0x0)) &&
|
||||
(isTargetFriendly = (GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>((iVar1 + 0x3c4)))))->Entity::HasEntityFlags(0x10000000000000),
|
||||
(isTargetFriendly = Entity::HasEntityFlags(*GHIDRA_CAST<Entity **>((iVar1 + 0x3c4)),0x10000000000000),
|
||||
isTargetFriendly != 0)) {
|
||||
return 1;
|
||||
}
|
||||
@@ -183,7 +183,7 @@ void PathFinder::EvadeTarget(Vector *targetPos, uint8_t isIgnoreStatusEffects)
|
||||
npc = (Entity_NPC *)
|
||||
__RTDynamicCast(*GHIDRA_CAST<uint32_t *>(this),0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor
|
||||
,&IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0,uVar4);
|
||||
playerTarget = (GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::GetPlayerTarget();
|
||||
playerTarget = Entity_NPC::GetPlayerTarget(npc);
|
||||
scratchPos.x = (playerTarget->_pos).x;
|
||||
scratchPos.y = (playerTarget->_pos).y;
|
||||
FindGridPath(this,&scratchPos,1.079,0,1);
|
||||
@@ -209,7 +209,7 @@ void PathFinder::EvadeTarget(Vector *targetPos, uint8_t isIgnoreStatusEffects)
|
||||
(GHIDRA_INT(pfVar1) + g_game->_frameCount) % 0xe == 0)) {
|
||||
scratchPos.x = *local_38;
|
||||
scratchPos.y = local_38[1];
|
||||
bVar3 = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::CheckLine(&scratchPos,targetPos,1,0,0,0,GHIDRA_CAST<Vector *>(0x0));
|
||||
bVar3 = Room::CheckLine(g_game->_room,&scratchPos,targetPos,1,0,0,0,GHIDRA_CAST<Vector *>(0x0));
|
||||
if (bVar3 == 0) {
|
||||
fVar9 = 170.0;
|
||||
}
|
||||
@@ -366,16 +366,16 @@ LAB_007e4e8c:
|
||||
local_38 = GHIDRA_CAST<float *>(scratchPos.y);
|
||||
local_2c = scratchPos.x;
|
||||
local_28 = pRVar11;
|
||||
uVar4 = (GHIDRA_CAST<Room *>((pRVar11)))->Room::GetGridCollision(iVar8);
|
||||
uVar4 = Room::GetGridCollision(pRVar11,iVar8);
|
||||
if (uVar4 == 0) {
|
||||
npcPos.x = *GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>(this) + 0x33c));
|
||||
npcPos.y = *GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>(this) + 0x340));
|
||||
bVar3 = (GHIDRA_CAST<Room *>((pRVar11)))->Room::CheckLine(&npcPos,&scratchPos,1,0,(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x738))),0,
|
||||
bVar3 = Room::CheckLine(pRVar11,&npcPos,&scratchPos,1,0,(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x738))),0,
|
||||
GHIDRA_CAST<Vector *>(0x0));
|
||||
if (bVar3 != 0) {
|
||||
npcPosCopy.x = *GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>(this) + 0x33c));
|
||||
npcPosCopy.y = *GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>(this) + 0x340));
|
||||
bVar3 = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::CheckLine(targetPos,&npcPosCopy,1,0,(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x738))),0,
|
||||
bVar3 = Room::CheckLine(g_game->_room,targetPos,&npcPosCopy,1,0,(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x738))),0,
|
||||
GHIDRA_CAST<Vector *>(0x0));
|
||||
if ((bVar3 == 0) || (20.0 <= *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x4)))))) {
|
||||
local_44 = *GHIDRA_CAST<float *>((this + 1));
|
||||
@@ -420,7 +420,8 @@ LAB_007e4e8c:
|
||||
targetPos_00 = local_3c;
|
||||
fVar9 = local_3c->x;
|
||||
if (iVar6 % 10 == 0) {
|
||||
bVar3 = (GHIDRA_CAST<Room *>((game->_room)))->Room::CheckLine(targetPos,local_3c,1,0,(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x738))),0,GHIDRA_CAST<Vector *>(0x0));
|
||||
bVar3 = Room::CheckLine(game->_room,targetPos,local_3c,1,0,(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x738))),0,GHIDRA_CAST<Vector *>(0x0)
|
||||
);
|
||||
if ((bVar3 == 0) ||
|
||||
(20.0 < *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x4)))) || *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x4)))) == 20.0)) {
|
||||
fVar10 = targetPos->x - local_3c->x;
|
||||
@@ -504,15 +505,15 @@ void PathFinder::MoveRandomlyAxisAligned(float speed, uint8_t isIgnoreStatusEffe
|
||||
npc = (Entity_NPC *)
|
||||
__RTDynamicCast(iVar8,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
||||
&IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0);
|
||||
(GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::CalcTargetPosition(&scratchVec,0.0);
|
||||
Entity_NPC::CalcTargetPosition(npc,&scratchVec,0.0);
|
||||
if (((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(this) + 0x168)) & 0x20000000) != 0) &&
|
||||
((playerTarget = (GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::GetPlayerTarget(), playerTarget->_type == 1 &&
|
||||
((playerTarget = Entity_NPC::GetPlayerTarget(npc), playerTarget->_type == 1 &&
|
||||
(scratchVec.x = (npc->_pos).x - scratchVec.x, scratchVec.y = (npc->_pos).y - scratchVec.y,
|
||||
scratchVec.y * scratchVec.y + scratchVec.x * scratchVec.x < 1600.0)))) {
|
||||
*GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>(this) + 0x36c)) = *GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>(this) + 0x36c)) * 0.8;
|
||||
return;
|
||||
}
|
||||
pVVar2 = (GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::CalcTargetPosition(&scratchVec,0.0);
|
||||
pVVar2 = Entity_NPC::CalcTargetPosition(npc,&scratchVec,0.0);
|
||||
FindGridPath(this,pVVar2,speed,0,1);
|
||||
scratchVec.y = (npc->_velocity).y;
|
||||
scratchVec.x = (npc->_velocity).x;
|
||||
@@ -721,7 +722,7 @@ LAB_007e5b55:
|
||||
} while (GHIDRA_INT(uVar4) < iVar8);
|
||||
}
|
||||
else {
|
||||
playerTarget = (GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::GetPlayerTarget();
|
||||
playerTarget = Entity_NPC::GetPlayerTarget(npc);
|
||||
fVar14 = (playerTarget->_pos).x - *GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>(this) + 0x33c));
|
||||
fVar12 = (playerTarget->_pos).y - *GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>(this) + 0x340));
|
||||
uVar7 = uVar4;
|
||||
@@ -783,7 +784,7 @@ LAB_007e5b55:
|
||||
((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(this) + 0x168)) & 0x1000800) != 0)) && (-1 < GHIDRA_INT(uVar3))) {
|
||||
if ((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(this) + 0x168)) & 0x1000800) != 0) {
|
||||
pVVar2 = Isaac::GetAxisAlignedUnitVectorFromDir(&chosenDirVec,uVar3);
|
||||
playerTarget = (GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::GetPlayerTarget();
|
||||
playerTarget = Entity_NPC::GetPlayerTarget(npc);
|
||||
fVar14 = (playerTarget->_pos).y - *GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>(this) + 0x340));
|
||||
toPlayerDirX = (playerTarget->_pos).x - *GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>(this) + 0x33c));
|
||||
fVar12 = sqrtf(fVar14 * fVar14 + toPlayerDirX * toPlayerDirX);
|
||||
@@ -863,7 +864,7 @@ LAB_007e5e93:
|
||||
else {
|
||||
iVar8 = gridRoom->_gridWidth * iVar10 + iVar8;
|
||||
}
|
||||
uVar6 = (GHIDRA_CAST<Room *>((gridRoom)))->Room::GetGridCollision(iVar8);
|
||||
uVar6 = Room::GetGridCollision(gridRoom,iVar8);
|
||||
if (uVar6 != 4) goto LAB_007e5ee3;
|
||||
}
|
||||
}
|
||||
@@ -996,7 +997,7 @@ uint8_t PathFinder::MoveRandomly(uint8_t isIgnoreStatusEffects)
|
||||
bVar1 = 1;
|
||||
iVar5 = 0;
|
||||
fVar4 = 0.5;
|
||||
targetPos = (GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::CalcTargetPosition(&local_10,0.0);
|
||||
targetPos = Entity_NPC::CalcTargetPosition(npc,&local_10,0.0);
|
||||
FindGridPath(this,targetPos,fVar4,iVar5,bVar1);
|
||||
return 1;
|
||||
}
|
||||
@@ -1004,7 +1005,7 @@ uint8_t PathFinder::MoveRandomly(uint8_t isIgnoreStatusEffects)
|
||||
npc = (Entity_NPC *)
|
||||
__RTDynamicCast(iVar5,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
||||
&IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0);
|
||||
target = (GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::GetPlayerTarget();
|
||||
target = Entity_NPC::GetPlayerTarget(npc);
|
||||
local_10.x = (target->_pos).x;
|
||||
local_10.y = (target->_pos).y;
|
||||
EvadeTarget(this,&local_10,0);
|
||||
@@ -1025,7 +1026,7 @@ uint8_t PathFinder::MoveRandomly(uint8_t isIgnoreStatusEffects)
|
||||
local_10.x = fVar2 * 40.0 + local_10.x;
|
||||
pos.y = local_10.x;
|
||||
pos.x = fVar4;
|
||||
iVar5 = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::GetGridCollisionAtPos(pos);
|
||||
iVar5 = Room::GetGridCollisionAtPos(g_game->_room,pos);
|
||||
if (iVar5 == 0) {
|
||||
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) = fVar4;
|
||||
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = local_10.x;
|
||||
@@ -1091,7 +1092,7 @@ void PathFinder::MoveRandomlyBoss(uint8_t isIgnoreStatusEffects)
|
||||
bVar1 = 1;
|
||||
iVar7 = 0;
|
||||
fVar6 = 0.5;
|
||||
pVVar2 = (GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::CalcTargetPosition(&local_10,0.0);
|
||||
pVVar2 = Entity_NPC::CalcTargetPosition(npc,&local_10,0.0);
|
||||
FindGridPath(this,pVVar2,fVar6,iVar7,bVar1);
|
||||
return;
|
||||
}
|
||||
@@ -1099,7 +1100,7 @@ void PathFinder::MoveRandomlyBoss(uint8_t isIgnoreStatusEffects)
|
||||
npc = (Entity_NPC *)
|
||||
__RTDynamicCast(iVar7,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
||||
&IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0);
|
||||
playerTarget = (GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::GetPlayerTarget();
|
||||
playerTarget = Entity_NPC::GetPlayerTarget(npc);
|
||||
local_10.x = (playerTarget->_pos).x;
|
||||
local_10.y = (playerTarget->_pos).y;
|
||||
EvadeTarget(this,&local_10,0);
|
||||
@@ -1131,7 +1132,7 @@ void PathFinder::MoveRandomlyBoss(uint8_t isIgnoreStatusEffects)
|
||||
}
|
||||
local_10.x = (GHIDRA_CAST<Vector *>((iVar7 + 0x33c)))->x;
|
||||
local_10.y = *GHIDRA_CAST<float *>((iVar7 + 0x340));
|
||||
iVar7 = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::GetGridCollisionAtPos(*GHIDRA_CAST<Vector *>((iVar7 + 0x33c)));
|
||||
iVar7 = Room::GetGridCollisionAtPos(g_game->_room,*GHIDRA_CAST<Vector *>((iVar7 + 0x33c)));
|
||||
if (iVar7 == 0) {
|
||||
uVar3 = Random();
|
||||
if (uVar3 % 0x1e == 0) {
|
||||
@@ -1147,7 +1148,7 @@ void PathFinder::MoveRandomlyBoss(uint8_t isIgnoreStatusEffects)
|
||||
}
|
||||
}
|
||||
if (((*GHIDRA_CAST<Entity **>(this))->_collidesWithGrid != 0) &&
|
||||
(bVar1 = (GHIDRA_CAST<Entity *>((*GHIDRA_CAST<Entity **>(this))))->Entity::IsFrame(5,0), bVar1 != 0)) {
|
||||
(bVar1 = Entity::IsFrame(*GHIDRA_CAST<Entity **>(this),5,0), bVar1 != 0)) {
|
||||
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) ^ 0x80000000;
|
||||
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x10)))) = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x10)))) ^ 0x80000000;
|
||||
}
|
||||
@@ -1166,7 +1167,7 @@ void PathFinder::MoveRandomlyBoss(uint8_t isIgnoreStatusEffects)
|
||||
else {
|
||||
iVar7 = room->_gridWidth * gridY + iVar7;
|
||||
}
|
||||
uVar3 = (GHIDRA_CAST<Room *>((room)))->Room::GetGridCollision(iVar7);
|
||||
uVar3 = Room::GetGridCollision(room,iVar7);
|
||||
if ((uVar3 == 0) || (triesLeft < 1)) break;
|
||||
uVar3 = Random();
|
||||
local_18.x = (float)((double)GHIDRA_INT(uVar3) + __uint_to_double_fixup[-(GHIDRA_INT(uVar3) >> 0x1f)]) *
|
||||
@@ -1238,7 +1239,7 @@ void PathFinder::update_chase_movement()
|
||||
local_20.y = (float)pEVar1;
|
||||
if (pEVar1->_controllerID != -1) {
|
||||
pEVar1->_friction = pEVar1->_friction * 0.6;
|
||||
controllerInput = (GHIDRA_CAST<Entity_NPC *>((pEVar1)))->Entity_NPC::GetControllerInput(&local_20,0.0);
|
||||
controllerInput = Entity_NPC::GetControllerInput(pEVar1,&local_20,0.0);
|
||||
fVar3 = pEVar1->_speedMultiplier;
|
||||
fVar4 = controllerInput->y;
|
||||
(pEVar1->_velocity).x = controllerInput->x * 1.2 * 1.25 * fVar3 + (pEVar1->_velocity).x;
|
||||
@@ -1259,13 +1260,13 @@ void PathFinder::update_chase_movement()
|
||||
if ((npcFlags & 0x200) == 0) {
|
||||
if ((npcFlags & 0x100) == 0) {
|
||||
if ((npcFlags & 0x1000800) == 0) goto LAB_007e6de9;
|
||||
target = (GHIDRA_CAST<Entity_NPC *>((GHIDRA_CAST<Entity_NPC *>(fVar3))))->Entity_NPC::GetPlayerTarget();
|
||||
target = Entity_NPC::GetPlayerTarget(GHIDRA_CAST<Entity_NPC *>(fVar3));
|
||||
fVar4 = (GHIDRA_CAST<Vector *>((GHIDRA_INT(fVar3) + 0x33c)))->x - (target->_pos).x;
|
||||
fVar3 = (GHIDRA_CAST<Vector *>((GHIDRA_INT(fVar3) + 0x33c)))->y - (target->_pos).y;
|
||||
}
|
||||
else {
|
||||
local_20.y = (float)(GHIDRA_CAST<Entity_NPC *>((GHIDRA_CAST<Entity_NPC *>(fVar3))))->Entity_NPC::GetPlayerTarget();
|
||||
isFrame = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(fVar3))))->Entity::IsFrame(5,*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(fVar3) + 0x20)));
|
||||
local_20.y = (float)Entity_NPC::GetPlayerTarget(GHIDRA_CAST<Entity_NPC *>(fVar3));
|
||||
isFrame = Entity::IsFrame(GHIDRA_CAST<Entity *>(fVar3),5,*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(fVar3) + 0x20)));
|
||||
if (isFrame == 0) goto LAB_007e6de9;
|
||||
Reset(in_ECX);
|
||||
local_20.x = (GHIDRA_CAST<Vector *>((GHIDRA_INT(local_20.y) + 0x33c)))->x;
|
||||
|
||||
Reference in new issue
Block a user