Files
isaac-port/generated-src/stat_hud.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

767 lines
28 KiB
C++

#include "classes.h"
// 0084c2c0
void StatHUD::Render(float *param_1)
{
KColor color;
byte bVar1;
char *format;
void *glyphs;
int in_ECX;
AnimationState *overlayAnim;
char *plainFormat;
int *piVar2;
byte *pbVar3;
char isDealChanceCombined;
int *playerSlot;
uint uVar4;
uint uVar5;
undefined1 auVar6 [16];
float spacing;
float columnX;
float fVar7;
undefined1 glyphBuffer [16];
undefined4 local_ac;
undefined4 local_a8;
undefined4 local_a4;
undefined4 local_a0;
undefined4 local_9c;
undefined4 local_98;
undefined4 local_94;
float local_90;
float local_8c;
float originX;
float originY;
undefined4 local_80;
undefined4 local_7c;
KColor local_78;
float textY;
float textX;
float secondPlayerOffsetY;
uint playerIndex;
float rowY;
Font *font;
float local_4c;
undefined4 local_48;
int hud;
float rowSpacing;
Vector iconPos;
char isDealChanceCombinedSaved;
byte textBuffers [24];
uint local_18;
void *local_10;
undefined1 *puStack_c;
undefined4 local_8;
int changeTimer;
local_8 = 0xffffffff;
puStack_c = &LAB_00b02f23;
local_10 = ExceptionList;
local_18 = __security_cookie ^ GHIDRA_UINT((textBuffers + 0x2c));
ExceptionList = &local_10;
if (((g_manager->_optionsConfig)._enableFoundHUD != 0) &&
((*GHIDRA_CAST<int *>((in_ECX + 0x114)) != 0 || (*GHIDRA_CAST<int *>((in_ECX + 0x1e0)) != 0)))) {
spacing = 12.0;
font = &g_manager->_font8_LuaMiniOutlined;
isDealChanceCombined = *GHIDRA_CAST<char *>((in_ECX + 0x2ac));
rowSpacing = 12.0;
secondPlayerOffsetY = (float)&DAT_bf800000;
originY = param_1[1];
if ((*GHIDRA_CAST<int *>((in_ECX + 0x114)) != 0) && (*GHIDRA_CAST<int *>((in_ECX + 0x1e0)) != 0)) {
spacing = 14.0;
secondPlayerOffsetY = -5.0;
rowSpacing = 14.0;
}
originX = *param_1;
uVar4 = 0;
hud = in_ECX;
iconPos.x = originX;
iconPos.y = originY;
isDealChanceCombinedSaved = isDealChanceCombined;
do {
if ((uVar4 != 8) && (uVar4 != 9)) {
if ((uVar4 == 6) && (isDealChanceCombined != '\0')) {
if (*GHIDRA_CAST<int *>((in_ECX + 0x34)) != 0) {
AnimationState::AdvancePosition
(GHIDRA_CAST<AnimationState *>((in_ECX + 0x30)),
*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((in_ECX + 0x34)) + 0x30)) + -1);
}
*GHIDRA_CAST<undefined4 *>((in_ECX + 0xb4)) = 0x3f000000;
if (*GHIDRA_CAST<char *>((in_ECX + 0x109)) != '\0') {
if (*GHIDRA_CAST<char *>((in_ECX + 0x70)) == '\0') {
AnimationState::Render
(GHIDRA_CAST<AnimationState *>((in_ECX + 0x30)),&iconPos,&g_vectorZero,&g_vectorZero);
overlayAnim = GHIDRA_CAST<AnimationState *>((in_ECX + 0x50));
}
else {
AnimationState::Render
(GHIDRA_CAST<AnimationState *>((in_ECX + 0x50)),&iconPos,&g_vectorZero,&g_vectorZero);
overlayAnim = GHIDRA_CAST<AnimationState *>((in_ECX + 0x30));
}
AnimationState::Render(overlayAnim,&iconPos,&g_vectorZero,&g_vectorZero);
}
uVar4 = 7;
}
else {
if (*GHIDRA_CAST<int *>((in_ECX + 0x34)) != 0) {
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((in_ECX + 0x30)))))->AnimationState::SetFrameFloat((float)GHIDRA_INT(uVar4));
}
*GHIDRA_CAST<undefined4 *>((in_ECX + 0xb4)) = 0x3f000000;
if (*GHIDRA_CAST<char *>((in_ECX + 0x109)) != '\0') {
if (*GHIDRA_CAST<char *>((hud + 0x70)) == '\0') {
AnimationState::Render
(GHIDRA_CAST<AnimationState *>((in_ECX + 0x30)),&iconPos,&g_vectorZero,&g_vectorZero);
overlayAnim = GHIDRA_CAST<AnimationState *>((in_ECX + 0x50));
}
else {
AnimationState::Render
(GHIDRA_CAST<AnimationState *>((in_ECX + 0x50)),&iconPos,&g_vectorZero,&g_vectorZero);
overlayAnim = GHIDRA_CAST<AnimationState *>((in_ECX + 0x30));
}
AnimationState::Render(overlayAnim,&iconPos,&g_vectorZero,&g_vectorZero);
in_ECX = hud;
}
}
iconPos.y = iconPos.y + rowSpacing;
spacing = rowSpacing;
isDealChanceCombined = isDealChanceCombinedSaved;
}
uVar4 = uVar4 + 1;
} while (uVar4 < 10);
playerIndex = 0;
do {
playerSlot = GHIDRA_CAST<int *>((in_ECX + 0x114 + playerIndex * 0xcc));
if (*playerSlot == 0) {
ExceptionList = local_10;
return;
}
uVar5 = 0;
auVar6 = ZEXT416(GHIDRA_UINT(originY));
rowY = originY;
fVar7 = (float)((double)GHIDRA_INT(playerIndex) + __uint_to_double_fixup[-(GHIDRA_INT(playerIndex) >> 0x1f)]
);
columnX = fVar7 * 4.0 + originX;
uVar4 = playerIndex;
local_90 = fVar7;
local_8c = columnX;
do {
if (((uVar5 != 8) && (uVar5 != 9)) && ((uVar5 != 7 || (isDealChanceCombined == '\0')))) {
if (((uVar5 == 6) || (uVar5 == 7)) ||
((uVar5 == 0 &&
((*GHIDRA_CAST<int *>((*playerSlot + 0x13c0)) == 0x13 || (*GHIDRA_CAST<int *>((*playerSlot + 0x13c0)) == 0x14)))
))) {
if (uVar4 == 0) goto LAB_0084c580;
}
else {
auVar6 = ZEXT416(GHIDRA_UINT((fVar7 * 7.0 + secondPlayerOffsetY + (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar6)) + 0x0))))));
LAB_0084c580:
textBuffers[0x14] = 0;
textBuffers[0x15] = 0;
textBuffers[0x16] = 0;
textBuffers[0x17] = 0;
textBuffers[8] = 0;
textBuffers[9] = 0;
textBuffers[10] = 0;
textBuffers[0xb] = 0;
textY = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar6)) + 0x0))) + (g_game->_screenShakeOffset).y + 1.0;
textX = columnX + (g_game->_screenShakeOffset).x + 16.0;
textBuffers[0xc] = 0;
textBuffers[0xd] = 0;
textBuffers[0xe] = 0;
textBuffers[0xf] = 0;
textBuffers[0x10] = 0;
textBuffers[0x11] = 0;
textBuffers[0x12] = 0;
textBuffers[0x13] = 0;
textBuffers[0] = 0;
textBuffers[1] = 0;
textBuffers[2] = 0;
textBuffers[3] = 0;
textBuffers[4] = 0;
textBuffers[5] = 0;
textBuffers[6] = 0;
textBuffers[7] = 0;
if (uVar5 == 6) {
bVar1 = (GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(*playerSlot))))->Entity_Player::HasTrinket(7,0);
if (bVar1 == 0) {
LAB_0084c6ec:
sprintf_s(textBuffers + 0xc,0xc,GHIDRA_CAST<byte *>("%.1f%%"));
format = "+%.1f%%";
plainFormat = "%.1f%%";
goto LAB_0084c717;
}
pbVar3 = textBuffers + 0xc;
format = "%.1f%%";
LAB_0084c735:
sprintf_s(pbVar3,0xc,GHIDRA_CAST<byte *>(format));
}
else {
if (uVar5 != 7) {
sprintf_s(textBuffers + 0xc,0xc,&DAT_00b67750);
format = "+%.2f";
plainFormat = &DAT_00b67750;
LAB_0084c717:
if ((float)playerSlot[uVar5 * 5 + 2] <= 0.0) {
format = plainFormat;
}
pbVar3 = textBuffers;
goto LAB_0084c735;
}
bVar1 = (GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(*playerSlot))))->Entity_Player::HasTrinket(7,0);
if (bVar1 == 0) goto LAB_0084c6ec;
local_48 = 0x42c80000;
local_4c = (float)playerSlot[0x1f] + (float)playerSlot[0x24];
sprintf_s(textBuffers + 0xc,0xc,GHIDRA_CAST<byte *>("%.1f%%"));
format = "+%.1f%%";
if ((float)playerSlot[0x20] + (float)playerSlot[0x25] <= 0.0) {
format = "%.1f%%";
}
sprintf_s(textBuffers,0xc,GHIDRA_CAST<byte *>(format));
piVar2 = playerSlot + 0x28;
if (playerSlot[0x28] < playerSlot[0x23]) {
piVar2 = playerSlot + 0x23;
}
playerSlot[0x28] = *piVar2;
}
if (playerIndex == 0) {
local_4c = 1.0;
}
else {
local_4c = 0.8;
}
local_80 = 0;
local_7c = 0xffff;
local_78._red = 0.0;
local_78._green = 1.0;
local_78._blue = -NAN;
local_78._alpha = 0.0;
local_78._unk = 0;
local_8 = 0;
local_48 = local_4c;
glyphs = (GHIDRA_CAST<Font *>((font)))->Font::measure_string(glyphBuffer,textBuffers + 0xc,&local_80,&g_vectorOne)
;
local_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),1);
color._green = (float)local_48;
color._red = 1.0;
color._blue = local_4c;
color._alpha = 0.5;
color._unk = 0;
Font::render_glyph_quads(font,glyphs,textX,textY,1.0,1.0,color,&local_80);
std::vector<12byte>::clear();
std::vector<12byte>::_Tidy();
pbVar3 = textBuffers;
local_8 = 0xffffffff;
do {
bVar1 = *pbVar3;
pbVar3 = pbVar3 + 1;
} while (bVar1 != 0);
if ((pbVar3 != textBuffers + 1) &&
(changeTimer = playerSlot[uVar5 * 5 + 5], 0 < changeTimer)) {
local_78._alpha = 1.0;
spacing = 0.0;
if (changeTimer < 0x88) {
if (changeTimer < 0x1e) {
local_78._alpha = ((float)changeTimer - 0.0) / 30.0;
}
}
else {
local_78._alpha = ((float)changeTimer - 150.0) / -15.0;
spacing = (1.0 - local_78._alpha) * (1.0 - local_78._alpha) * -20.0;
}
local_78._alpha = local_78._alpha * 0.5;
if ((float)playerSlot[uVar5 * 5 + 2] < 0.0) {
local_78._green = 0.03;
local_78._red = 0.9;
}
else {
local_78._green = 0.9;
local_78._red = 0.03;
}
local_78._blue = 0.03;
local_78._unk = 0;
local_ac = 0;
local_a8 = 0xffff;
local_a4 = 0;
local_a0 = 0x3f800000;
local_9c = 0xffffffff;
local_98 = 0;
local_94 = 0;
local_8 = 2;
(GHIDRA_CAST<Font *>((font)))->Font::DrawString(textBuffers,&local_78,&local_ac,spacing + textX + 30.0,textY);
}
local_8 = 0xffffffff;
auVar6 = ZEXT416(GHIDRA_UINT(rowY));
uVar4 = playerIndex;
spacing = rowSpacing;
columnX = local_8c;
fVar7 = local_90;
}
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar6)) + 0x0))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar6)) + 0x0))) + spacing;
rowY = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar6)) + 0x0)));
}
uVar5 = uVar5 + 1;
isDealChanceCombined = isDealChanceCombinedSaved;
} while (uVar5 < 10);
playerIndex = uVar4 + 1;
in_ECX = hud;
} while (playerIndex < 2);
}
ExceptionList = local_10;
return;
}
// 0084ca00
void StatHUD::RecomputeStats(int playerId, uint flags, byte unk)
{
int framesSinceUpdate;
undefined4 isAnimated;
if ((-1 < playerId) && (this[playerId * 0x33 + 0x45] != (StatHUD)0x0)) {
framesSinceUpdate = g_game->_frameCount - *GHIDRA_CAST<int *>((GHIDRA_INT(this[playerId * 0x33 + 0x45]) + 0x328));
isAnimated = CONCAT31((int3)(GHIDRA_UINT(framesSinceUpdate) >> 8),1 < framesSinceUpdate);
if ((flags & 1) != 0) {
StatTracker::set(isAnimated);
}
if ((flags & 2) != 0) {
StatTracker::set(isAnimated);
}
if ((flags & 4) != 0) {
StatTracker::set(isAnimated);
}
if ((flags & 8) != 0) {
StatTracker::set(isAnimated);
}
if ((flags & 0x10) != 0) {
StatTracker::set(isAnimated);
}
if ((flags & 0x20) != 0) {
StatTracker::set(isAnimated);
}
if ((flags & 0xc0) != 0) {
(GHIDRA_CAST<Room *>((g_game->_room)))->Room::GetDevilRoomChance();
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::CanSpawnDevilRoom();
get_angel_room_chance();
if (*GHIDRA_CAST<char *>((this + 0xab)) == '\0') {
StatTracker::set(isAnimated);
}
else {
StatTracker::set(isAnimated);
}
StatTracker::set(isAnimated);
}
if ((flags & 0x100) != 0) {
StatTracker::set(isAnimated);
}
if ((flags & 0x200) != 0) {
StatTracker::set(isAnimated);
}
}
return;
}
// 0084cc40
void StatHUD::update_player(Entity_Player *oldPlayer, Entity_Player *newPlayer)
{
byte isDevilRoomPossible;
StatHUD SVar1;
StatHUD timer;
StatHUD *statA;
StatHUD *statB;
float fVar2;
StatHUD SVar3;
StatHUD minTimer;
uint local_20;
StatHUD *angelChanceStat;
StatHUD dealChance;
Game *game;
bool isAnimateChange;
minTimer = (StatHUD)0x87;
local_20 = 0;
do {
if (this[local_20 * 0x33 + 0x45] == (StatHUD)oldPlayer) {
this[local_20 * 0x33 + 0x45] = (StatHUD)newPlayer;
if ((-1 < GHIDRA_INT(local_20)) && (newPlayer != GHIDRA_CAST<Entity_Player *>(0x0))) {
if (g_game->_frameCount - newPlayer->_spawnFrame < 2) {
SVar1 = this[local_20 * 0x33 + 0x46];
statA = this + local_20 * 0x33 + 0x5f;
this[local_20 * 0x33 + 0x46] = (StatHUD)newPlayer->_movespeed;
this[local_20 * 0x33 + 0x48] = SVar1;
this[local_20 * 0x33 + 0x47] = (StatHUD)0x0;
this[local_20 * 0x33 + 0x4a] = (StatHUD)0x0;
fVar2 = newPlayer->_maxfiredelay;
this[local_20 * 0x33 + 0x4d] = this[local_20 * 0x33 + 0x4b];
this[local_20 * 0x33 + 0x4c] = (StatHUD)0x0;
this[local_20 * 0x33 + 0x4f] = (StatHUD)0x0;
isAnimateChange = false;
this[local_20 * 0x33 + 0x4b] = (StatHUD)(30.0 / (fVar2 + 1.0));
SVar1 = this[local_20 * 0x33 + 0x50];
this[local_20 * 0x33 + 0x50] = (StatHUD)newPlayer->_damage;
this[local_20 * 0x33 + 0x52] = SVar1;
this[local_20 * 0x33 + 0x51] = (StatHUD)0x0;
this[local_20 * 0x33 + 0x54] = (StatHUD)0x0;
fVar2 = newPlayer->_tearrange;
this[local_20 * 0x33 + 0x57] = this[local_20 * 0x33 + 0x55];
this[local_20 * 0x33 + 0x56] = (StatHUD)0x0;
this[local_20 * 0x33 + 0x59] = (StatHUD)0x0;
this[local_20 * 0x33 + 0x55] = (StatHUD)(fVar2 / 40.0);
SVar1 = (StatHUD)newPlayer->_shotspeed;
this[local_20 * 0x33 + 0x5c] = this[local_20 * 0x33 + 0x5a];
this[local_20 * 0x33 + 0x5b] = (StatHUD)0x0;
this[local_20 * 0x33 + 0x5e] = (StatHUD)0x0;
this[local_20 * 0x33 + 0x5a] = SVar1;
SVar3 = (StatHUD)newPlayer->_luck;
statA[2] = *statA;
statA[1] = (StatHUD)0x0;
statA[4] = (StatHUD)0x0;
}
else {
SVar1 = (StatHUD)newPlayer->_movespeed;
SVar3 = this[local_20 * 0x33 + 0x46];
if ((float)SVar1 == (float)SVar3) {
LAB_0084cec8:
this[local_20 * 0x33 + 0x46] = SVar1;
statA = this + local_20 * 0x33 + 0x4b;
fVar2 = *GHIDRA_CAST<float *>((GHIDRA_INT(this[local_20 * 0x33 + 0x45]) + 0x1460));
SVar1 = *statA;
}
else {
timer = this[local_20 * 0x33 + 0x4a];
if (0x1e < GHIDRA_INT(timer)) {
if (GHIDRA_INT(timer) < 0x87) {
timer = (StatHUD)0x87;
}
this[local_20 * 0x33 + 0x4a] = timer;
this[local_20 * 0x33 + 0x47] =
(StatHUD)((float)SVar1 - (float)this[local_20 * 0x33 + 0x48]);
goto LAB_0084cec8;
}
this[local_20 * 0x33 + 0x48] = SVar3;
this[local_20 * 0x33 + 0x47] = (StatHUD)((float)SVar1 - (float)SVar3);
if ((float)this[local_20 * 0x33 + 0x49] <= ABS((float)SVar1 - (float)SVar3)) {
this[local_20 * 0x33 + 0x4a] = (StatHUD)0x96;
}
this[local_20 * 0x33 + 0x46] = SVar1;
fVar2 = newPlayer->_maxfiredelay;
statA = this + local_20 * 0x33 + 0x4b;
SVar1 = *statA;
}
SVar3 = (StatHUD)(30.0 / (fVar2 + 1.0));
if ((float)SVar3 == (float)SVar1) {
*statA = SVar3;
LAB_0084cf67:
statB = this + local_20 * 0x33 + 0x50;
SVar1 = *statB;
}
else {
timer = statA[4];
if (0x1e < GHIDRA_INT(timer)) {
statA[1] = (StatHUD)((float)SVar3 - (float)statA[2]);
if (GHIDRA_INT(timer) < 0x87) {
timer = (StatHUD)0x87;
}
statA[4] = timer;
*statA = SVar3;
goto LAB_0084cf67;
}
statA[2] = SVar1;
statA[1] = (StatHUD)((float)SVar3 - (float)SVar1);
if ((float)statA[3] <= ABS((float)SVar3 - (float)SVar1)) {
statA[4] = (StatHUD)0x96;
}
statB = this + local_20 * 0x33 + 0x50;
*statA = SVar3;
SVar1 = *statB;
}
SVar3 = *GHIDRA_CAST<StatHUD *>((GHIDRA_INT(this[local_20 * 0x33 + 0x45]) + 0x1470));
if ((float)SVar3 == (float)SVar1) {
*statB = SVar3;
LAB_0084cff2:
statA = this + local_20 * 0x33 + 0x55;
SVar1 = *statA;
}
else {
timer = statB[4];
if (0x1e < GHIDRA_INT(timer)) {
statB[1] = (StatHUD)((float)SVar3 - (float)statB[2]);
if (GHIDRA_INT(timer) < 0x87) {
timer = (StatHUD)0x87;
}
statB[4] = timer;
*statB = SVar3;
goto LAB_0084cff2;
}
statB[2] = SVar1;
statB[1] = (StatHUD)((float)SVar3 - (float)SVar1);
if ((float)statB[3] <= ABS((float)SVar3 - (float)SVar1)) {
statB[4] = (StatHUD)0x96;
}
statA = this + local_20 * 0x33 + 0x55;
*statB = SVar3;
SVar1 = *statA;
}
SVar3 = (StatHUD)(*GHIDRA_CAST<float *>((GHIDRA_INT(this[local_20 * 0x33 + 0x45]) + 0x1480)) / 40.0);
if ((float)SVar3 == (float)SVar1) {
*statA = SVar3;
LAB_0084d081:
statB = this + local_20 * 0x33 + 0x5a;
SVar1 = *statB;
}
else {
timer = statA[4];
if (0x1e < GHIDRA_INT(timer)) {
statA[1] = (StatHUD)((float)SVar3 - (float)statA[2]);
if (GHIDRA_INT(timer) < 0x87) {
timer = (StatHUD)0x87;
}
statA[4] = timer;
*statA = SVar3;
goto LAB_0084d081;
}
statA[2] = SVar1;
statA[1] = (StatHUD)((float)SVar3 - (float)SVar1);
if ((float)statA[3] <= ABS((float)SVar3 - (float)SVar1)) {
statA[4] = (StatHUD)0x96;
}
statB = this + local_20 * 0x33 + 0x5a;
*statA = SVar3;
SVar1 = *statB;
}
SVar3 = *GHIDRA_CAST<StatHUD *>((GHIDRA_INT(this[local_20 * 0x33 + 0x45]) + 0x1464));
if ((float)SVar3 == (float)SVar1) {
*statB = SVar3;
LAB_0084d10c:
statA = this + local_20 * 0x33 + 0x5f;
SVar1 = *statA;
}
else {
timer = statB[4];
if (0x1e < GHIDRA_INT(timer)) {
statB[1] = (StatHUD)((float)SVar3 - (float)statB[2]);
if (GHIDRA_INT(timer) < 0x87) {
timer = (StatHUD)0x87;
}
statB[4] = timer;
*statB = SVar3;
goto LAB_0084d10c;
}
statB[2] = SVar1;
statB[1] = (StatHUD)((float)SVar3 - (float)SVar1);
if ((float)statB[3] <= ABS((float)SVar3 - (float)SVar1)) {
statB[4] = (StatHUD)0x96;
}
statA = this + local_20 * 0x33 + 0x5f;
*statB = SVar3;
SVar1 = *statA;
}
isAnimateChange = true;
SVar3 = *GHIDRA_CAST<StatHUD *>((GHIDRA_INT(this[local_20 * 0x33 + 0x45]) + 0x156c));
if ((float)SVar3 != (float)SVar1) {
timer = statA[4];
if (GHIDRA_INT(timer) < 0x1f) {
statA[2] = SVar1;
statA[1] = (StatHUD)((float)SVar3 - (float)SVar1);
if ((float)statA[3] <= ABS((float)SVar3 - (float)SVar1)) {
statA[4] = (StatHUD)0x96;
}
}
else {
statA[1] = (StatHUD)((float)SVar3 - (float)statA[2]);
if (GHIDRA_INT(timer) < 0x87) {
timer = (StatHUD)0x87;
}
statA[4] = timer;
}
isAnimateChange = true;
}
}
game = g_game;
*statA = SVar3;
dealChance = (StatHUD)(GHIDRA_CAST<Room *>((game->_room)))->Room::GetDevilRoomChance();
if ((float)dealChance <= 0.0) {
dealChance = (StatHUD)0x0;
}
if (1.0 <= (float)dealChance) {
dealChance = (StatHUD)0x3f800000;
}
isDevilRoomPossible = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::CanSpawnDevilRoom();
if (isDevilRoomPossible == 0) {
dealChance = (StatHUD)0x0;
}
fVar2 = get_angel_room_chance();
if (*GHIDRA_CAST<char *>((this + 0xab)) == '\0') {
SVar1 = this[local_20 * 0x33 + 100];
SVar3 = (StatHUD)((1.0 - fVar2) * (float)dealChance * 100.0);
if (!isAnimateChange) {
this[local_20 * 0x33 + 0x66] = SVar1;
this[local_20 * 0x33 + 100] = SVar3;
dealChance = (StatHUD)((float)dealChance * fVar2 * 100.0);
goto LAB_0084d33e;
}
if ((float)SVar3 == (float)SVar1) {
LAB_0084d460:
angelChanceStat = this + local_20 * 0x33 + 0x69;
this[local_20 * 0x33 + 100] = SVar3;
SVar1 = *angelChanceStat;
}
else {
timer = this[local_20 * 0x33 + 0x68];
if (0x1e < GHIDRA_INT(timer)) {
if (GHIDRA_INT(timer) < 0x87) {
timer = (StatHUD)0x87;
}
this[local_20 * 0x33 + 0x68] = timer;
this[local_20 * 0x33 + 0x65] =
(StatHUD)((float)SVar3 - (float)this[local_20 * 0x33 + 0x66]);
goto LAB_0084d460;
}
this[local_20 * 0x33 + 0x66] = SVar1;
this[local_20 * 0x33 + 0x65] = (StatHUD)((float)SVar3 - (float)SVar1);
if ((float)this[local_20 * 0x33 + 0x67] <= ABS((float)SVar3 - (float)SVar1)) {
this[local_20 * 0x33 + 0x68] = (StatHUD)0x96;
}
angelChanceStat = this + local_20 * 0x33 + 0x69;
this[local_20 * 0x33 + 100] = SVar3;
SVar1 = *angelChanceStat;
}
dealChance = (StatHUD)((float)dealChance * fVar2 * 100.0);
if ((float)dealChance == (float)SVar1) goto LAB_0084d4c3;
LAB_0084d484:
if (GHIDRA_INT(angelChanceStat[4]) < 0x1f) {
angelChanceStat[2] = SVar1;
angelChanceStat[1] = (StatHUD)((float)dealChance - (float)SVar1);
if ((float)angelChanceStat[3] <= ABS((float)dealChance - (float)SVar1)) {
angelChanceStat[4] = (StatHUD)0x96;
}
}
else {
angelChanceStat[1] = (StatHUD)((float)dealChance - (float)angelChanceStat[2]);
SVar1 = angelChanceStat[4];
if (GHIDRA_INT(angelChanceStat[4]) < 0x87) {
SVar1 = minTimer;
}
angelChanceStat[4] = SVar1;
}
}
else {
SVar1 = this[local_20 * 0x33 + 100];
dealChance = (StatHUD)((float)dealChance * 100.0);
if (isAnimateChange) {
if ((float)dealChance == (float)SVar1) {
LAB_0084d2d1:
angelChanceStat = this + local_20 * 0x33 + 0x69;
this[local_20 * 0x33 + 100] = dealChance;
SVar1 = *angelChanceStat;
}
else {
SVar3 = this[local_20 * 0x33 + 0x68];
if (0x1e < GHIDRA_INT(SVar3)) {
if (GHIDRA_INT(SVar3) < 0x87) {
SVar3 = (StatHUD)0x87;
}
this[local_20 * 0x33 + 0x68] = SVar3;
this[local_20 * 0x33 + 0x65] =
(StatHUD)((float)dealChance - (float)this[local_20 * 0x33 + 0x66]);
goto LAB_0084d2d1;
}
this[local_20 * 0x33 + 0x66] = SVar1;
this[local_20 * 0x33 + 0x65] = (StatHUD)((float)dealChance - (float)SVar1);
if ((float)this[local_20 * 0x33 + 0x67] <= ABS((float)dealChance - (float)SVar1)) {
this[local_20 * 0x33 + 0x68] = (StatHUD)0x96;
}
this[local_20 * 0x33 + 100] = dealChance;
angelChanceStat = this + local_20 * 0x33 + 0x69;
SVar1 = *angelChanceStat;
}
if ((float)dealChance != (float)SVar1) goto LAB_0084d484;
}
else {
this[local_20 * 0x33 + 0x66] = SVar1;
this[local_20 * 0x33 + 100] = dealChance;
LAB_0084d33e:
angelChanceStat = this + local_20 * 0x33 + 0x69;
this[local_20 * 0x33 + 0x68] = (StatHUD)0x0;
this[local_20 * 0x33 + 0x65] = (StatHUD)0x0;
angelChanceStat[2] = *angelChanceStat;
angelChanceStat[1] = (StatHUD)0x0;
angelChanceStat[4] = (StatHUD)0x0;
}
}
LAB_0084d4c3:
*angelChanceStat = dealChance;
game = g_game;
SVar1 = this[local_20 * 0x33 + 0x6e];
if (isAnimateChange) {
if ((float)SVar1 == 0.0) {
LAB_0084d5c7:
this[local_20 * 0x33 + 0x6e] = (StatHUD)0x0;
statA = this + local_20 * 0x33 + 0x73;
SVar1 = *statA;
}
else {
SVar3 = this[local_20 * 0x33 + 0x72];
if (0x1e < GHIDRA_INT(SVar3)) {
if (GHIDRA_INT(SVar3) < 0x87) {
SVar3 = (StatHUD)0x87;
}
this[local_20 * 0x33 + 0x72] = SVar3;
this[local_20 * 0x33 + 0x6f] = (StatHUD)(0.0 - (float)this[local_20 * 0x33 + 0x70]);
goto LAB_0084d5c7;
}
this[local_20 * 0x33 + 0x70] = SVar1;
this[local_20 * 0x33 + 0x6f] = (StatHUD)(0.0 - (float)SVar1);
if ((float)this[local_20 * 0x33 + 0x71] <= ABS(0.0 - (float)SVar1)) {
this[local_20 * 0x33 + 0x72] = (StatHUD)0x96;
}
this[local_20 * 0x33 + 0x6e] = (StatHUD)0x0;
statA = this + local_20 * 0x33 + 0x73;
SVar1 = *statA;
}
SVar3 = (StatHUD)((g_game->_itemPool)._unkFloat674 * 100.0);
if ((float)SVar3 != (float)SVar1) {
timer = statA[4];
if (GHIDRA_INT(timer) < 0x1f) {
statA[2] = SVar1;
statA[1] = (StatHUD)((float)SVar3 - (float)SVar1);
if ((float)statA[3] <= ABS((float)SVar3 - (float)SVar1)) {
statA[4] = (StatHUD)0x96;
*statA = SVar3;
goto LAB_0084d698;
}
}
else {
statA[1] = (StatHUD)((float)SVar3 - (float)statA[2]);
if (GHIDRA_INT(timer) < 0x87) {
timer = (StatHUD)0x87;
}
statA[4] = timer;
}
}
*statA = SVar3;
}
else {
statA = this + local_20 * 0x33 + 0x73;
this[local_20 * 0x33 + 0x70] = SVar1;
this[local_20 * 0x33 + 0x6f] = (StatHUD)0x0;
this[local_20 * 0x33 + 0x72] = (StatHUD)0x0;
this[local_20 * 0x33 + 0x6e] = (StatHUD)0x0;
fVar2 = (game->_itemPool)._unkFloat674;
statA[2] = *statA;
statA[1] = (StatHUD)0x0;
statA[4] = (StatHUD)0x0;
*statA = (StatHUD)(fVar2 * 100.0);
}
}
}
else if (this[local_20 * 0x33 + 0x45] == (StatHUD)newPlayer) {
this[local_20 * 0x33 + 0x45] = (StatHUD)oldPlayer;
RecomputeStats(this,local_20,0xffffffff,(byte)local_20);
}
LAB_0084d698:
local_20 = local_20 + 1;
if (1 < local_20) {
return;
}
} while( true );
}