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>
15831 lines
683 KiB
C++
15831 lines
683 KiB
C++
#include "classes.h"
|
|
|
|
// 00407490
|
|
Vector * Game::ScreenShakeOffset()
|
|
{
|
|
return &this->_screenShakeOffset;
|
|
}
|
|
|
|
// 004074b0
|
|
int Game::GetFrameCount()
|
|
{
|
|
return this->_frameCount;
|
|
}
|
|
|
|
// 00417850
|
|
DeathmatchManager * Game::GetField26614()
|
|
{
|
|
return &g_game->_deathmatchManager;
|
|
}
|
|
|
|
// 00417860
|
|
PlayerManager * Game::GetPlayerManager()
|
|
{
|
|
return &this->_playerManager;
|
|
}
|
|
|
|
// 00417870
|
|
Entity_Player * Game::GetPlayer(uint Index)
|
|
{
|
|
void *playersEnd;
|
|
undefined4 *puVar1;
|
|
|
|
playersEnd = (this->_playerManager)._playerList._end;
|
|
puVar1 = (this->_playerManager)._playerList._begin;
|
|
if (GHIDRA_INT(playersEnd) - GHIDRA_INT(puVar1) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
playersEnd = (this->_playerManager)._playerList._end;
|
|
puVar1 = (this->_playerManager)._playerList._begin;
|
|
}
|
|
if (Index < GHIDRA_UINT((GHIDRA_INT(playersEnd) - GHIDRA_INT(puVar1) >> 2))) {
|
|
return GHIDRA_CAST<Entity_Player *>(puVar1[Index]);
|
|
}
|
|
return GHIDRA_CAST<Entity_Player *>(*puVar1);
|
|
}
|
|
|
|
// 004178d0
|
|
int Game::GetNumPlayers()
|
|
{
|
|
return GHIDRA_INT((this->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((this->_playerManager)._playerList._begin) >> 2;
|
|
}
|
|
|
|
// 004178e0
|
|
HUD * Game::GetHUD()
|
|
{
|
|
return &this->_hud;
|
|
}
|
|
|
|
// 00420ba0
|
|
undefined4 Game::load_bossoverlays_xml(byte *param_1)
|
|
{
|
|
qword qVar1;
|
|
byte bVar2;
|
|
uint uVar3;
|
|
int *file;
|
|
undefined4 uVar4;
|
|
int iVar5;
|
|
byte *text;
|
|
void *node;
|
|
void *anm2RootAttr;
|
|
byte ****ppppbVar6;
|
|
undefined4 *in_ECX;
|
|
byte *pbVar7;
|
|
byte *pbVar8;
|
|
byte *pbVar9;
|
|
std_string *allocSource;
|
|
char *persistKeyChar;
|
|
qword *heapCounter;
|
|
bool bVar10;
|
|
undefined4 *attr;
|
|
uint overlayId;
|
|
byte ****anm2Path;
|
|
undefined4 uStack_100d0;
|
|
undefined4 uStack_100cc;
|
|
undefined4 uStack_100c8;
|
|
uint anm2PathSize;
|
|
uint anm2PathCapacity;
|
|
byte ****animName [4];
|
|
uint animNameSize;
|
|
uint animNameCapacity;
|
|
undefined1 isPersist;
|
|
undefined1 xmlDoc [48];
|
|
undefined1 auStack_10070 [65564];
|
|
byte ****anm2Root [4];
|
|
uint anm2RootSize;
|
|
uint anm2RootCapacity;
|
|
byte ****tmpString;
|
|
undefined4 uStack_38;
|
|
undefined4 uStack_34;
|
|
undefined4 uStack_30;
|
|
uint tmpStringSize;
|
|
uint tmpStringCapacity;
|
|
uint local_24;
|
|
undefined1 *puStack_20;
|
|
void *local_1c;
|
|
undefined1 *puStack_18;
|
|
byte ***local_14;
|
|
|
|
puStack_20 = GHIDRA_CAST<undefined1 *>((anm2Root + 0x14));
|
|
local_14 = GHIDRA_CAST<byte ***>(0xffffffff);
|
|
puStack_18 = &LAB_00af17c3;
|
|
local_1c = ExceptionList;
|
|
uVar3 = __security_cookie ^ GHIDRA_UINT((anm2Root + 0x11));
|
|
ExceptionList = &local_1c;
|
|
*in_ECX = 0;
|
|
local_24 = uVar3;
|
|
file = (GHIDRA_CAST<FileSystem *>((&PTR_vftable_00c37a10)))->FileSystem::Open(param_1,GHIDRA_CAST<int *>(0x0));
|
|
if (file == GHIDRA_CAST<int *>(0x0)) {
|
|
uVar4 = 0;
|
|
}
|
|
else {
|
|
iVar5 = (**(code **)(*file + 4))(uVar3);
|
|
text = operator_new_tracked(iVar5 + 1);
|
|
(**(code **)(*file + 0x14))(text,1,iVar5);
|
|
text[iVar5] = 0;
|
|
(**(code **)*file)(1);
|
|
FUN_00413b90();
|
|
local_14 = GHIDRA_CAST<byte ***>(0x0);
|
|
uVar3 = 0x420c75;
|
|
pbVar9 = text;
|
|
(GHIDRA_CAST<rapidxml::xml_document *>((xmlDoc)))->rapidxml::xml_document::parse(text);
|
|
bVar2 = (byte)pbVar9;
|
|
node = (GHIDRA_CAST<xml_node *>((xmlDoc)))->xml_node::first_node(GHIDRA_CAST<byte *>("bossoverlay"),uVar3,bVar2);
|
|
anm2RootAttr = (GHIDRA_CAST<xml_node *>((node)))->xml_node::first_attribute(GHIDRA_CAST<byte *>("anm2root"),uVar3,bVar2);
|
|
anm2RootSize = 0;
|
|
anm2RootCapacity = 0xf;
|
|
anm2Root[0] = GHIDRA_CAST<byte ****>(0x0);
|
|
pbVar9 = &g_xmlNullStr;
|
|
if (*GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(anm2RootAttr) + 4)) != GHIDRA_CAST<byte *>(0x0)) {
|
|
pbVar9 = *GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(anm2RootAttr) + 4));
|
|
}
|
|
pbVar7 = pbVar9;
|
|
do {
|
|
bVar2 = *pbVar7;
|
|
pbVar7 = pbVar7 + 1;
|
|
} while (bVar2 != 0);
|
|
uVar3 = GHIDRA_INT(pbVar7) - GHIDRA_INT((pbVar9 + 1));
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(anm2Root))))->std::string::assign(pbVar9,uVar3);
|
|
for (node = (GHIDRA_CAST<xml_node *>((node)))->xml_node::first_node(GHIDRA_CAST<byte *>("entry"),GHIDRA_INT(pbVar9),(byte)uVar3);
|
|
node != (void *)0x0; node = *(void **)(GHIDRA_CAST<char *>(node) + 0x2c)) {
|
|
anm2PathCapacity = 0xf;
|
|
overlayId = 0;
|
|
anm2PathSize = 0;
|
|
anm2Path = GHIDRA_CAST<byte ****>(0x0);
|
|
animNameSize = 0;
|
|
animNameCapacity = 0xf;
|
|
animName[0] = GHIDRA_CAST<byte ****>(0x0);
|
|
isPersist = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))) = (undefined3)(GHIDRA_UINT(local_14) >> 8);
|
|
local_14 = GHIDRA_CAST<byte ***>(CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),2));
|
|
attr = *GHIDRA_CAST<undefined4 **>((GHIDRA_CAST<char *>(node) + 0x20));
|
|
uVar3 = 0;
|
|
if (attr == GHIDRA_CAST<undefined4 *>(0x0)) {
|
|
LAB_004210b2:
|
|
in_ECX[uVar3 * 0xe + 0x47] = uVar3;
|
|
if (GHIDRA_CAST<byte *****>((in_ECX + uVar3 * 0xe + 0x48)) != &anm2Path) {
|
|
ppppbVar6 = GHIDRA_CAST<byte ****>(&anm2Path);
|
|
if (0xf < anm2PathCapacity) {
|
|
ppppbVar6 = anm2Path;
|
|
}
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>((in_ECX + uVar3 * 0xe + 0x48)))))->std::string::assign(GHIDRA_CAST<byte *>(ppppbVar6),anm2PathSize);
|
|
}
|
|
if (GHIDRA_CAST<byte *****>((in_ECX + uVar3 * 0xe + 0x4e)) != animName) {
|
|
ppppbVar6 = GHIDRA_CAST<byte ****>(animName);
|
|
if (0xf < animNameCapacity) {
|
|
ppppbVar6 = animName[0];
|
|
}
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>((in_ECX + uVar3 * 0xe + 0x4e)))))->std::string::assign(GHIDRA_CAST<byte *>(ppppbVar6),animNameSize);
|
|
}
|
|
*GHIDRA_CAST<undefined1 *>((in_ECX + uVar3 * 0xe + 0x54)) = isPersist;
|
|
}
|
|
else {
|
|
do {
|
|
pbVar9 = GHIDRA_CAST<byte *>(*attr);
|
|
pbVar8 = s_id;
|
|
pbVar7 = &g_xmlNullStr;
|
|
if (pbVar9 != GHIDRA_CAST<byte *>(0x0)) {
|
|
pbVar7 = pbVar9;
|
|
}
|
|
do {
|
|
bVar2 = *pbVar7;
|
|
bVar10 = bVar2 < *pbVar8;
|
|
if (bVar2 != *pbVar8) {
|
|
LAB_00420d91:
|
|
uVar3 = -GHIDRA_UINT(bVar10) | 1;
|
|
goto LAB_00420d96;
|
|
}
|
|
if (bVar2 == 0) break;
|
|
bVar2 = pbVar7[1];
|
|
bVar10 = bVar2 < pbVar8[1];
|
|
if (bVar2 != pbVar8[1]) goto LAB_00420d91;
|
|
pbVar7 = pbVar7 + 2;
|
|
pbVar8 = pbVar8 + 2;
|
|
} while (bVar2 != 0);
|
|
uVar3 = 0;
|
|
LAB_00420d96:
|
|
if (uVar3 == 0) {
|
|
pbVar9 = &g_xmlNullStr;
|
|
if (GHIDRA_CAST<byte *>(attr[1]) != GHIDRA_CAST<byte *>(0x0)) {
|
|
pbVar9 = GHIDRA_CAST<byte *>(attr[1]);
|
|
}
|
|
overlayId = atoi(GHIDRA_CAST<char *>(pbVar9));
|
|
}
|
|
else {
|
|
pbVar8 = &DAT_00b1bff4;
|
|
pbVar7 = &g_xmlNullStr;
|
|
if (pbVar9 != GHIDRA_CAST<byte *>(0x0)) {
|
|
pbVar7 = pbVar9;
|
|
}
|
|
do {
|
|
bVar2 = *pbVar7;
|
|
bVar10 = bVar2 < *pbVar8;
|
|
if (bVar2 != *pbVar8) {
|
|
LAB_00420df0:
|
|
uVar3 = -GHIDRA_UINT(bVar10) | 1;
|
|
goto LAB_00420df5;
|
|
}
|
|
if (bVar2 == 0) break;
|
|
bVar2 = pbVar7[1];
|
|
bVar10 = bVar2 < pbVar8[1];
|
|
if (bVar2 != pbVar8[1]) goto LAB_00420df0;
|
|
pbVar7 = pbVar7 + 2;
|
|
pbVar8 = pbVar8 + 2;
|
|
} while (bVar2 != 0);
|
|
uVar3 = 0;
|
|
LAB_00420df5:
|
|
if (uVar3 == 0) {
|
|
pbVar9 = &g_xmlNullStr;
|
|
if (GHIDRA_CAST<byte *>(attr[1]) != GHIDRA_CAST<byte *>(0x0)) {
|
|
pbVar9 = GHIDRA_CAST<byte *>(attr[1]);
|
|
}
|
|
pbVar7 = pbVar9;
|
|
do {
|
|
bVar2 = *pbVar7;
|
|
pbVar7 = pbVar7 + 1;
|
|
} while (bVar2 != 0);
|
|
allocSource = GHIDRA_CAST<std_string *>((pbVar7 + -GHIDRA_INT((pbVar9 + 1))));
|
|
if (GHIDRA_CAST<std_string *>((0x7fffffff - anm2RootSize)) < allocSource) {
|
|
/* WARNING: Subroutine does not return */
|
|
std::string::_Xlen();
|
|
}
|
|
ppppbVar6 = GHIDRA_CAST<byte ****>(anm2Root);
|
|
if (0xf < anm2RootCapacity) {
|
|
ppppbVar6 = anm2Root[0];
|
|
}
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(&tmpString))))->std::string::concat(GHIDRA_INT(in_ECX),allocSource,GHIDRA_CAST<byte *>(ppppbVar6),
|
|
anm2RootSize,pbVar9,GHIDRA_UINT(allocSource));
|
|
if (0xf < anm2PathCapacity) {
|
|
uVar3 = anm2PathCapacity + 1;
|
|
ppppbVar6 = anm2Path;
|
|
if (0xfff < uVar3) {
|
|
ppppbVar6 = GHIDRA_CAST<byte ****>(anm2Path[-1]);
|
|
uVar3 = anm2PathCapacity + 0x24;
|
|
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>((GHIDRA_INT(anm2Path) + (-4 - GHIDRA_INT(ppppbVar6)))))
|
|
goto LAB_004211de;
|
|
}
|
|
operator_delete(ppppbVar6,uVar3);
|
|
}
|
|
anm2Path = tmpString;
|
|
uStack_100d0 = uStack_38;
|
|
uStack_100cc = uStack_34;
|
|
uStack_100c8 = uStack_30;
|
|
anm2PathSize = tmpStringSize;
|
|
anm2PathCapacity = tmpStringCapacity;
|
|
}
|
|
else {
|
|
pbVar8 = &DAT_00b1bffc;
|
|
pbVar7 = &g_xmlNullStr;
|
|
if (pbVar9 != GHIDRA_CAST<byte *>(0x0)) {
|
|
pbVar7 = pbVar9;
|
|
}
|
|
do {
|
|
bVar2 = *pbVar7;
|
|
bVar10 = bVar2 < *pbVar8;
|
|
if (bVar2 != *pbVar8) {
|
|
LAB_00420ed8:
|
|
uVar3 = -GHIDRA_UINT(bVar10) | 1;
|
|
goto LAB_00420edd;
|
|
}
|
|
if (bVar2 == 0) break;
|
|
bVar2 = pbVar7[1];
|
|
bVar10 = bVar2 < pbVar8[1];
|
|
if (bVar2 != pbVar8[1]) goto LAB_00420ed8;
|
|
pbVar7 = pbVar7 + 2;
|
|
pbVar8 = pbVar8 + 2;
|
|
} while (bVar2 != 0);
|
|
uVar3 = 0;
|
|
LAB_00420edd:
|
|
if (uVar3 == 0) {
|
|
pbVar9 = &g_xmlNullStr;
|
|
if (GHIDRA_CAST<byte *>(attr[1]) != GHIDRA_CAST<byte *>(0x0)) {
|
|
pbVar9 = GHIDRA_CAST<byte *>(attr[1]);
|
|
}
|
|
pbVar7 = pbVar9;
|
|
do {
|
|
bVar2 = *pbVar7;
|
|
pbVar7 = pbVar7 + 1;
|
|
} while (bVar2 != 0);
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(animName))))->std::string::assign(pbVar9,GHIDRA_INT(pbVar7) - GHIDRA_INT((pbVar9 + 1)));
|
|
}
|
|
else {
|
|
persistKeyChar = "persist";
|
|
pbVar7 = &g_xmlNullStr;
|
|
if (pbVar9 != GHIDRA_CAST<byte *>(0x0)) {
|
|
pbVar7 = pbVar9;
|
|
}
|
|
do {
|
|
bVar2 = *pbVar7;
|
|
bVar10 = bVar2 < (byte)*persistKeyChar;
|
|
if (bVar2 != *persistKeyChar) {
|
|
LAB_00420f40:
|
|
uVar3 = -GHIDRA_UINT(bVar10) | 1;
|
|
goto LAB_00420f45;
|
|
}
|
|
if (bVar2 == 0) break;
|
|
bVar2 = pbVar7[1];
|
|
bVar10 = bVar2 < (byte)persistKeyChar[1];
|
|
if (bVar2 != persistKeyChar[1]) goto LAB_00420f40;
|
|
pbVar7 = pbVar7 + 2;
|
|
persistKeyChar = persistKeyChar + 2;
|
|
} while (bVar2 != 0);
|
|
uVar3 = 0;
|
|
LAB_00420f45:
|
|
if (uVar3 == 0) {
|
|
tmpString = GHIDRA_CAST<byte ****>(0x0);
|
|
tmpStringSize = 0;
|
|
pbVar9 = &g_xmlNullStr;
|
|
if (GHIDRA_CAST<byte *>(attr[1]) != GHIDRA_CAST<byte *>(0x0)) {
|
|
pbVar9 = GHIDRA_CAST<byte *>(attr[1]);
|
|
}
|
|
tmpStringCapacity = 0xf;
|
|
pbVar7 = pbVar9;
|
|
do {
|
|
bVar2 = *pbVar7;
|
|
pbVar7 = pbVar7 + 1;
|
|
} while (bVar2 != 0);
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(&tmpString))))->std::string::assign(pbVar9,GHIDRA_INT(pbVar7) - GHIDRA_INT((pbVar9 + 1)));
|
|
if (tmpStringSize == 0) {
|
|
LAB_00421045:
|
|
isPersist = 0;
|
|
}
|
|
else {
|
|
ppppbVar6 = GHIDRA_CAST<byte ****>(&tmpString);
|
|
if (0xf < tmpStringCapacity) {
|
|
ppppbVar6 = tmpString;
|
|
}
|
|
if (tmpStringSize == 4) {
|
|
if ((*ppppbVar6 == GHIDRA_CAST<byte ***>(0x65757274)) ||
|
|
((((bVar2 = (byte)*ppppbVar6, bVar10 = bVar2 < 0x74, bVar2 == 0x74 &&
|
|
(bVar10 = *GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(ppppbVar6) + 1)) < 0x72,
|
|
*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(ppppbVar6) + 1)) == 0x72)) &&
|
|
(bVar10 = *GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(ppppbVar6) + 2)) < 0x75,
|
|
*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(ppppbVar6) + 2)) == 0x75)) &&
|
|
(bVar10 = *GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(ppppbVar6) + 3)) < 0x65,
|
|
*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(ppppbVar6) + 3)) == 0x65)))) {
|
|
uVar3 = 0;
|
|
}
|
|
else {
|
|
uVar3 = -GHIDRA_UINT(bVar10) | 1;
|
|
}
|
|
if (uVar3 != 0) goto LAB_00420fdd;
|
|
}
|
|
else {
|
|
LAB_00420fdd:
|
|
ppppbVar6 = GHIDRA_CAST<byte ****>(&tmpString);
|
|
if (0xf < tmpStringCapacity) {
|
|
ppppbVar6 = tmpString;
|
|
}
|
|
if (tmpStringSize == 4) {
|
|
if ((*ppppbVar6 == GHIDRA_CAST<byte ***>(0x65757254)) ||
|
|
(((bVar2 = (byte)*ppppbVar6, bVar10 = bVar2 < 0x54, bVar2 == 0x54 &&
|
|
(bVar10 = *GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(ppppbVar6) + 1)) < 0x72,
|
|
*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(ppppbVar6) + 1)) == 0x72)) &&
|
|
((bVar10 = *GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(ppppbVar6) + 2)) < 0x75,
|
|
*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(ppppbVar6) + 2)) == 0x75 &&
|
|
(bVar10 = *GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(ppppbVar6) + 3)) < 0x65,
|
|
*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(ppppbVar6) + 3)) == 0x65)))))) {
|
|
uVar3 = 0;
|
|
}
|
|
else {
|
|
uVar3 = -GHIDRA_UINT(bVar10) | 1;
|
|
}
|
|
if (uVar3 == 0) goto LAB_0042103c;
|
|
}
|
|
ppppbVar6 = GHIDRA_CAST<byte ****>(&tmpString);
|
|
if (0xf < tmpStringCapacity) {
|
|
ppppbVar6 = tmpString;
|
|
}
|
|
iVar5 = atoi(GHIDRA_CAST<char *>(ppppbVar6));
|
|
if (iVar5 == 0) goto LAB_00421045;
|
|
}
|
|
LAB_0042103c:
|
|
isPersist = 1;
|
|
}
|
|
if (0xf < tmpStringCapacity) {
|
|
uVar3 = tmpStringCapacity + 1;
|
|
ppppbVar6 = tmpString;
|
|
if (0xfff < uVar3) {
|
|
ppppbVar6 = GHIDRA_CAST<byte ****>(tmpString[-1]);
|
|
uVar3 = tmpStringCapacity + 0x24;
|
|
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>((GHIDRA_INT(tmpString) + (-4 - GHIDRA_INT(ppppbVar6)))))
|
|
goto LAB_004211de;
|
|
}
|
|
operator_delete(ppppbVar6,uVar3);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} while ((attr[4] != 0) && (attr = GHIDRA_CAST<undefined4 *>(attr[6]), attr != GHIDRA_CAST<undefined4 *>(0x0)));
|
|
uVar3 = overlayId;
|
|
if (overlayId < 5) goto LAB_004210b2;
|
|
}
|
|
local_14 = GHIDRA_CAST<byte ***>(CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),1));
|
|
if (0xf < animNameCapacity) {
|
|
uVar3 = animNameCapacity + 1;
|
|
ppppbVar6 = animName[0];
|
|
if (0xfff < uVar3) {
|
|
ppppbVar6 = GHIDRA_CAST<byte ****>(animName[0][-1]);
|
|
uVar3 = animNameCapacity + 0x24;
|
|
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>((GHIDRA_INT(animName[0]) + (-4 - GHIDRA_INT(ppppbVar6))))) goto LAB_004211de;
|
|
}
|
|
operator_delete(ppppbVar6,uVar3);
|
|
}
|
|
if (0xf < anm2PathCapacity) {
|
|
uVar3 = anm2PathCapacity + 1;
|
|
ppppbVar6 = anm2Path;
|
|
if (0xfff < uVar3) {
|
|
ppppbVar6 = GHIDRA_CAST<byte ****>(anm2Path[-1]);
|
|
uVar3 = anm2PathCapacity + 0x24;
|
|
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>((GHIDRA_INT(anm2Path) + (-4 - GHIDRA_INT(ppppbVar6))))) goto LAB_004211de;
|
|
}
|
|
operator_delete(ppppbVar6,uVar3);
|
|
}
|
|
}
|
|
local_14 = GHIDRA_CAST<byte ***>((GHIDRA_UINT(local_14) & 0xffffff00));
|
|
if (0xf < anm2RootCapacity) {
|
|
uVar3 = anm2RootCapacity + 1;
|
|
ppppbVar6 = anm2Root[0];
|
|
if (0xfff < uVar3) {
|
|
ppppbVar6 = GHIDRA_CAST<byte ****>(anm2Root[0][-1]);
|
|
uVar3 = anm2RootCapacity + 0x24;
|
|
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>((GHIDRA_INT(anm2Root[0]) + (-4 - GHIDRA_INT(ppppbVar6))))) {
|
|
LAB_004211de:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(ppppbVar6,uVar3);
|
|
}
|
|
local_14 = GHIDRA_CAST<byte ***>(0x3);
|
|
(GHIDRA_CAST<xml_memory_pool *>((auStack_10070)))->xml_memory_pool::clear();
|
|
if (g_mainHeap == (void *)0x0) {
|
|
heapCounter = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
heapCounter = GHIDRA_CAST<qword *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
if (text != GHIDRA_CAST<byte *>(0x0)) {
|
|
uVar3 = *GHIDRA_CAST<uint *>((text + -4));
|
|
qVar1 = *heapCounter;
|
|
*GHIDRA_CAST<uint *>(heapCounter) = GHIDRA_UINT(*heapCounter) - uVar3;
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(heapCounter) + 4)) =
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(heapCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar1) < uVar3));
|
|
free(text + -4);
|
|
}
|
|
uVar4 = 1;
|
|
}
|
|
ExceptionList = local_1c;
|
|
return uVar4;
|
|
}
|
|
|
|
// 00421770
|
|
int Game::Challenge()
|
|
{
|
|
return this->_challenge;
|
|
}
|
|
|
|
// 004217a0
|
|
byte Game::GetStateFlag(int flag)
|
|
{
|
|
uint highMask;
|
|
uint lowMask;
|
|
uint flagIndex;
|
|
|
|
if (flag < 1) {
|
|
flag = 0;
|
|
}
|
|
flagIndex = 0x34;
|
|
if (flag < 0x34) {
|
|
flagIndex = flag;
|
|
}
|
|
lowMask = 1 << (flagIndex & 0x1f);
|
|
highMask = 0;
|
|
if (0x1f < (flagIndex & 0x3f)) {
|
|
highMask = lowMask;
|
|
}
|
|
lowMask = lowMask ^ highMask;
|
|
if (0x3f < (flagIndex & 0x3f)) {
|
|
highMask = lowMask;
|
|
}
|
|
if ((lowMask & *GHIDRA_CAST<uint *>((this->_giantBookClickerImage + (flagIndex >> 6) * 8 + 0x28))) == 0 &&
|
|
(highMask & *GHIDRA_CAST<uint *>((this->_giantBookClickerImage + (flagIndex >> 6) * 8 + 0x2c))) == 0) {
|
|
return 0;
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 00423250
|
|
byte Game::GetGameStateFlag(uint GameStateFlag)
|
|
{
|
|
uint maskHigh;
|
|
uint maskLow;
|
|
|
|
maskLow = 1 << (GameStateFlag & 0x1f);
|
|
maskHigh = 0;
|
|
if (0x1f < (GameStateFlag & 0x3f)) {
|
|
maskHigh = maskLow;
|
|
}
|
|
maskLow = maskLow ^ maskHigh;
|
|
if (0x3f < (GameStateFlag & 0x3f)) {
|
|
maskHigh = maskLow;
|
|
}
|
|
if ((maskLow & this->_roomList[0]._doors[(GameStateFlag >> 6) * 2 + -0xc]) == 0 &&
|
|
(maskHigh & this->_roomList[0]._doors[(GameStateFlag >> 6) * 2 + -0xb]) == 0) {
|
|
return 0;
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 0042a330
|
|
ItemPool * Game::GetItemPool()
|
|
{
|
|
return &this->_itemPool;
|
|
}
|
|
|
|
// 0042a340
|
|
Seeds * Game::GetSeeds()
|
|
{
|
|
return &this->_seedEffects;
|
|
}
|
|
|
|
// 004305c0
|
|
void Game::Update(Vector *param_2)
|
|
{
|
|
void *settings;
|
|
KColor *color;
|
|
KColor *color_00;
|
|
KColor *color_01;
|
|
int extraout_EDX;
|
|
FontSettings fontSettings [7];
|
|
KColor textColor;
|
|
Vector textPos;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
Manager *manager;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00af1fcd;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
if ((char)this->_stage != '\0') {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x10))) != '\0') {
|
|
if (this->_stageType == 0x15) goto LAB_0043061e;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(this->_roomList))))->ANM2::Render(param_2,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
if (this->_stageType == 0x15) {
|
|
LAB_0043061e:
|
|
manager = g_manager;
|
|
textPos.x = param_2->x - 12.0;
|
|
textPos.y = param_2->y + 0.0;
|
|
(GHIDRA_CAST<FontSettings *>((fontSettings)))->FontSettings::constructor();
|
|
if (extraout_EDX < 0x14) {
|
|
local_8 = 0;
|
|
(GHIDRA_CAST<KColor *>((&textColor)))->KColor::SetFromARGB(0xffffffff);
|
|
(GHIDRA_CAST<Font *>((&manager->_font2_TeamMeatEx12)))->Font::DrawStringScaled(&DAT_00b1cebc,&textPos,color,settings);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if (extraout_EDX < 0x28) {
|
|
local_8 = 1;
|
|
(GHIDRA_CAST<KColor *>((&textColor)))->KColor::SetFromARGB(0xffffffff);
|
|
Font::DrawStringScaled
|
|
(&manager->_font2_TeamMeatEx12,&DAT_00b1ceb8,&textPos,color_00,settings);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
local_8 = 2;
|
|
(GHIDRA_CAST<KColor *>((&textColor)))->KColor::SetFromARGB(0xffffffff);
|
|
(GHIDRA_CAST<Font *>((&manager->_font2_TeamMeatEx12)))->Font::DrawStringScaled(&DAT_00b1cec0,&textPos,color_01,settings)
|
|
;
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&this->_roomList[1].SpawnSeed))))->ANM2::Render(param_2,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00431760
|
|
byte Game::GetDebugFlag(uint flag)
|
|
{
|
|
return (*GHIDRA_CAST<uint *>((this->_giantBookClickerImage + (flag >> 5) * 4 + 0x24)) &
|
|
1 << ((byte)flag & 0x1f)) != 0;
|
|
}
|
|
|
|
// 00440610
|
|
float10 Game::GetDarknessModifier()
|
|
{
|
|
return (float10)this->_darknessModifier;
|
|
}
|
|
|
|
// 00440620
|
|
float10 Game::GetTargetDarkness()
|
|
{
|
|
return (float10)this->_darknessStrength;
|
|
}
|
|
|
|
// 00440ee0
|
|
void Game::Darken(float strength, int timeout)
|
|
{
|
|
this->_darknessStrength = strength;
|
|
this->_darknessTimeout = timeout;
|
|
return;
|
|
}
|
|
|
|
// 00456860
|
|
ItemOverlay * Game::GetItemOverlay()
|
|
{
|
|
return &this->_itemOverlay;
|
|
}
|
|
|
|
// 004a5d00
|
|
bool Game::HasHallucination()
|
|
{
|
|
return 0 < this->_hallucinationTimer;
|
|
}
|
|
|
|
// 004d3390
|
|
void Game::SetStateFlag(uint param_1)
|
|
{
|
|
if (GHIDRA_INT(param_1) < 1) {
|
|
param_1 = 0;
|
|
}
|
|
if ((GHIDRA_INT(param_1) < 0x34) && (0x34 < param_1)) {
|
|
/* WARNING: Subroutine does not return */
|
|
std::bitset::_Xran();
|
|
}
|
|
FUN_004d72b0();
|
|
return;
|
|
}
|
|
|
|
// 0059e290
|
|
int Game::Difficulty()
|
|
{
|
|
return this->_difficulty;
|
|
}
|
|
|
|
// 005b1850
|
|
int Game::GetDevilRoomDeals()
|
|
{
|
|
return this->_devilRoomDeals;
|
|
}
|
|
|
|
// 005b1860
|
|
Ambush * Game::GetAmbush()
|
|
{
|
|
return &this->_ambush;
|
|
}
|
|
|
|
// 005b1870
|
|
void Game::ShowFortune()
|
|
{
|
|
ShowFortuneText(&this->_fortuneRNG,GHIDRA_CAST<byte *>("Fortune_General"));
|
|
return;
|
|
}
|
|
|
|
// 005b1890
|
|
void Game::room_restart_flag_set()
|
|
{
|
|
g_game->_isRoomRespawned = 1;
|
|
return;
|
|
}
|
|
|
|
// 0060d010
|
|
int * Game::GetRoomDescriptorsOffsetsArrayForDimension(int dimension)
|
|
{
|
|
if (dimension < 0) {
|
|
return this->_currentRoomMap;
|
|
}
|
|
return this->_roomMap + dimension * 0xa9;
|
|
}
|
|
|
|
// 0065d000
|
|
int Game::GetDonationModGreed()
|
|
{
|
|
return this->_donationModGreed;
|
|
}
|
|
|
|
// 00665c60
|
|
byte Game::IsInTimedSet(int key)
|
|
{
|
|
undefined1 findResult [8];
|
|
void *boundNode;
|
|
int keyValue;
|
|
|
|
keyValue = key;
|
|
std::set<int>::find_node(findResult,&key);
|
|
if ((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(boundNode) + 0xd)) == '\0') && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(boundNode) + 0x10)) <= keyValue)) {
|
|
return boundNode != (this->_seedEffects)._seedEffects;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 006b84b0
|
|
int Game::GetVictoryLap()
|
|
{
|
|
return this->_victoryLap;
|
|
}
|
|
|
|
// 006d8240
|
|
byte Game::IsHardMode()
|
|
{
|
|
if ((g_game->_difficulty == 1) || (g_game->_difficulty == 3)) {
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 006dae20
|
|
undefined1 Game::IsChallengeOrDaily()
|
|
{
|
|
if ((this->_challenge == 0) && ((this->_dailyChallenge)._id == 0)) {
|
|
return 0;
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 006f0070
|
|
undefined1 Game::IsRoomTransitionActive()
|
|
{
|
|
int *in_ECX;
|
|
|
|
if ((*in_ECX == 0) || (in_ECX[0x8e] == 0)) {
|
|
return 0;
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 006f1020
|
|
void Game::constructor()
|
|
{
|
|
int *piVar1;
|
|
uint uVar2;
|
|
void *allocation;
|
|
undefined4 uVar3;
|
|
DebugRenderer debugRenderer;
|
|
undefined4 *puVar4;
|
|
int *containerProxy;
|
|
void *extraout_EAX;
|
|
int iVar5;
|
|
std_set *spawnTriggerTargets;
|
|
void *local_1c;
|
|
undefined1 *puStack_18;
|
|
undefined4 local_14;
|
|
std_map *roomTransitionSprites;
|
|
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00afb82b;
|
|
local_1c = ExceptionList;
|
|
uVar2 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 0x10U;
|
|
ExceptionList = &local_1c;
|
|
_eh_vector_constructor_iterator_
|
|
(this->_roomList,0xb8,0x20f,RoomDescriptor::constructor,RoomDescriptor::destructor);
|
|
(this->_generationRNG)._shift1 = 5;
|
|
(this->_generationRNG)._shift2 = 9;
|
|
(this->_generationRNG)._seed = -0x55e8beb1;
|
|
(this->_generationRNG)._shift3 = 7;
|
|
(this->_devilAngelRoomRNG)._shift1 = 5;
|
|
(this->_devilAngelRoomRNG)._shift2 = 9;
|
|
(this->_devilAngelRoomRNG)._seed = -0x55e8beb1;
|
|
(this->_devilAngelRoomRNG)._shift3 = 7;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x182f8)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x182fc)))) = 0;
|
|
this->_room = (void *)0x0;
|
|
(this->_dungeonReturnPosition).y = 0.0;
|
|
(this->_dungeonReturnPosition).x = 0.0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x18398)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x18394)))) = 0;
|
|
this->_levelStateFlags = 0;
|
|
(this->_myosotisPickups)._begin = (void *)0x0;
|
|
(this->_myosotisPickups)._end = (void *)0x0;
|
|
(this->_myosotisPickups)._capacity = (void *)0x0;
|
|
local_14 = 2;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x188f8))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x188fc)))) = 0xffffffff;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x18900)))) = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x18904))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x18908)))) = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1890c))) = 0;
|
|
FUN_007384d0(uVar2);
|
|
this->_nbRooms = 0;
|
|
this->_isLevelGenerating = 0;
|
|
local_14 = 3;
|
|
_eh_vector_constructor_iterator_
|
|
(&this->_roomConfig,0xc4,0x25,RoomConfigStage::ctor,RoomConfig_Stage::game_destructor);
|
|
(this->_roomConfig)._curses._begin = (void *)0x0;
|
|
(this->_roomConfig)._curses._end = (void *)0x0;
|
|
(this->_roomConfig)._curses._capacity = (void *)0x0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 5;
|
|
_eh_vector_constructor_iterator_
|
|
(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1a570))),0x1c,0x10,GHIDRA_CAST<_func_void_void_ptr *>(&LAB_00829650),FUN_0069d1f0);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 6;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1a730)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1a734)))) = 0;
|
|
allocation = operator_new(100);
|
|
*(void **)allocation = allocation;
|
|
*(void **)(GHIDRA_CAST<char *>(allocation) + 4) = allocation;
|
|
*(void **)&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1a730))) = allocation;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 7;
|
|
this->_preloadManager = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1a73c)))) = 0;
|
|
allocation = operator_new(0x50);
|
|
*(void **)allocation = allocation;
|
|
*(void **)(GHIDRA_CAST<char *>(allocation) + 4) = allocation;
|
|
*(void **)(GHIDRA_CAST<char *>(allocation) + 8) = allocation;
|
|
*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(allocation) + 0xc)) = 0x101;
|
|
this->_preloadManager = allocation;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 8;
|
|
_eh_vector_constructor_iterator_
|
|
((this->_itemPool)._pools,0x34,0x1f,GHIDRA_CAST<_func_void_void_ptr *>(&LAB_00732c20),
|
|
GHIDRA_CAST<_func_void_void_ptr *>(&LAB_00732c80));
|
|
(this->_itemPool)._itemPoolRNG._seed = -0x55e8beb1;
|
|
iVar5 = 0x1f;
|
|
(this->_itemPool)._itemPoolRNG._shift1 = 5;
|
|
(this->_itemPool)._itemPoolRNG._shift2 = 9;
|
|
(this->_itemPool)._itemPoolRNG._shift3 = 7;
|
|
(this->_itemPool)._trinketPoolRNG._shift1 = 5;
|
|
(this->_itemPool)._trinketPoolRNG._shift2 = 9;
|
|
(this->_itemPool)._trinketPoolRNG._seed = -0x55e8beb1;
|
|
(this->_itemPool)._trinketPoolRNG._shift3 = 7;
|
|
(this->_itemPool)._removedCollectibles._begin = (void *)0x0;
|
|
(this->_itemPool)._removedCollectibles._end = (void *)0x0;
|
|
(this->_itemPool)._removedCollectibles._capacity = (void *)0x0;
|
|
(this->_itemPool)._removedCollectibles._size = 0;
|
|
(this->_itemPool)._roomBlacklistedCollectibles._begin = (void *)0x0;
|
|
(this->_itemPool)._roomBlacklistedCollectibles._end = (void *)0x0;
|
|
(this->_itemPool)._roomBlacklistedCollectibles._capacity = (void *)0x0;
|
|
(this->_itemPool)._roomBlacklistedCollectibles._size = 0;
|
|
(this->_itemPool)._trinketPoolItems._begin = (void *)0x0;
|
|
(this->_itemPool)._trinketPoolItems._end = (void *)0x0;
|
|
(this->_itemPool)._trinketPoolItems._capacity = (void *)0x0;
|
|
*GHIDRA_CAST<undefined8 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_itemPool))) + 0x69c)))) = 0xffffffffffffffff;
|
|
*GHIDRA_CAST<undefined8 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_itemPool))) + 0x6a4)))) = 0xffffffffffffffff;
|
|
*GHIDRA_CAST<undefined8 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_itemPool))) + 0x6ac)))) = 0xffffffffffffffff;
|
|
*GHIDRA_CAST<undefined8 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_itemPool))) + 0x6b4)))) = 0xffffffffffffffff;
|
|
*GHIDRA_CAST<undefined8 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_itemPool))) + 0x6bc)))) = 0xffffffffffffffff;
|
|
*GHIDRA_CAST<undefined8 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_itemPool))) + 0x6c4)))) = 0xffffffffffffffff;
|
|
*GHIDRA_CAST<undefined8 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_itemPool))) + 0x6cc)))) = 0xffffffffffffffff;
|
|
*GHIDRA_CAST<undefined8 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_itemPool))) + 0x6d4)))) = 0xffffffffffffffff;
|
|
*GHIDRA_CAST<undefined8 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_itemPool))) + 0x6dc)))) = 0xffffffffffffffff;
|
|
*GHIDRA_CAST<undefined8 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_itemPool))) + 0x6e4)))) = 0xffffffffffffffff;
|
|
*GHIDRA_CAST<undefined8 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_itemPool))) + 0x6ec)))) = 0xffffffffffffffff;
|
|
*GHIDRA_CAST<undefined8 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_itemPool))) + 0x6f4)))) = 0xffffffffffffffff;
|
|
*GHIDRA_CAST<undefined8 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_itemPool))) + 0x6fc)))) = 0xffffffffffffffff;
|
|
*GHIDRA_CAST<undefined8 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_itemPool))) + 0x704)))) = 0xffffffffffffffff;
|
|
*GHIDRA_CAST<undefined8 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_itemPool))) + 0x70c)))) = 0xffffffffffffffff;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_itemPool))) + 0x714)))) = 0xffffffff;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_itemPool))) + 0x6d8)))) = 4;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_itemPool))) + 0x6c8)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_itemPool))) + 0x6c4)))) = 0xc;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_itemPool))) + 0x6d4)))) = 3;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_itemPool))) + 0x6cc)))) = 6;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_itemPool))) + 0x6a4)))) = 1;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_itemPool))) + 0x6ac)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_itemPool))) + 0x6b0)))) = 2;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_itemPool))) + 0x6b8)))) = 5;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_itemPool))) + 0x6bc)))) = 5;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_itemPool))) + 0x6e0)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_itemPool))) + 0x6e4)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_itemPool))) + 0x6e8)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_itemPool))) + 0x6dc)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_itemPool))) + 0x6f4)))) = 1;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_itemPool))) + 0x6ec)))) = 8;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_itemPool))) + 0x6f0)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_itemPool))) + 0x6fc)))) = 0x1a;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_itemPool))) + 0x710)))) = 0x18;
|
|
puVar4 = GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_itemPool))) + 0x718))));
|
|
do {
|
|
uVar3 = puVar4[-0x1f];
|
|
switch(uVar3) {
|
|
case 0:
|
|
uVar3 = 0x10;
|
|
break;
|
|
case 1:
|
|
uVar3 = 0x12;
|
|
break;
|
|
case 2:
|
|
uVar3 = 0x11;
|
|
break;
|
|
case 3:
|
|
uVar3 = 0x13;
|
|
break;
|
|
case 4:
|
|
uVar3 = 0x14;
|
|
break;
|
|
case 5:
|
|
uVar3 = 0x16;
|
|
break;
|
|
case 0xc:
|
|
uVar3 = 0x15;
|
|
}
|
|
*puVar4 = uVar3;
|
|
puVar4 = puVar4 + 1;
|
|
iVar5 = iVar5 + -1;
|
|
} while (iVar5 != 0);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 9;
|
|
_eh_vector_constructor_iterator_
|
|
(&this->_bossPool,0x3c,0x25,GHIDRA_CAST<_func_void_void_ptr *>(&LAB_00421810),FUN_00421860);
|
|
(this->_bossPool)._removedBosses._begin = (void *)0x0;
|
|
(this->_bossPool)._removedBosses._end = (void *)0x0;
|
|
(this->_bossPool)._removedBosses._capacity = (void *)0x0;
|
|
(this->_bossPool)._removedBosses._size = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1b82c)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1b830)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1b834)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1b838)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&this->_roomTransition) = 0;
|
|
(this->_roomTransition)._frame = 0;
|
|
(this->_roomTransition)._duration = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_roomTransition))) + 0x20)))) = 0;
|
|
(this->_roomTransition)._flags = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_roomTransition))) + 0x28)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_roomTransition))) + 0x2c)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_roomTransition))) + 0x30)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_roomTransition))) + 0x34)))) = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xc;
|
|
(GHIDRA_CAST<ANM2 *>((&(this->_roomTransition)._versusScreenSprite)))->ANM2::constructor();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xd;
|
|
FUN_0040d170();
|
|
FUN_0040d170();
|
|
roomTransitionSprites = &(this->_roomTransition)._sprites;
|
|
roomTransitionSprites->_head = (void *)0x0;
|
|
(this->_roomTransition)._sprites._size = 0;
|
|
allocation = operator_new(0x128);
|
|
*(void **)allocation = allocation;
|
|
*(void **)(GHIDRA_CAST<char *>(allocation) + 4) = allocation;
|
|
*(void **)(GHIDRA_CAST<char *>(allocation) + 8) = allocation;
|
|
*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(allocation) + 0xc)) = 0x101;
|
|
roomTransitionSprites->_head = allocation;
|
|
(this->_roomTransition)._slideOffset.y = 0.0;
|
|
(this->_roomTransition)._slideOffset.x = 0.0;
|
|
(this->_roomTransition)._minecart = (EntityPtr)0x0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xf;
|
|
FUN_0082ed00();
|
|
(this->_roomTransition)._bossIntroBossId = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&this->_stageTransition) = 0;
|
|
(this->_stageTransition)._frame = 0;
|
|
(this->_stageTransition)._duration = 0x32;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1ba8c))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1ba94)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1ba90)))) = 0;
|
|
(this->_fortuneRNG)._shift1 = 5;
|
|
(this->_fortuneRNG)._shift2 = 9;
|
|
(this->_fortuneRNG)._seed = -0x55e8beb1;
|
|
(this->_fortuneRNG)._shift3 = 7;
|
|
(this->_playerManager)._playerList._begin = (void *)0x0;
|
|
(this->_playerManager)._playerList._end = (void *)0x0;
|
|
(this->_playerManager)._playerList._capacity = (void *)0x0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_playerManager))) + 0x5c))) = 1;
|
|
(this->_playerManager)._coopPlayerTypes._begin = (void *)0x0;
|
|
(this->_playerManager)._coopPlayerTypes._end = (void *)0x0;
|
|
(this->_playerManager)._coopPlayerTypes._capacity = (void *)0x0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_playerManager))) + 0x7c)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_playerManager))) + 0xa4)))) = 0;
|
|
*GHIDRA_CAST<undefined8 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_playerManager))) + 0xac)))) = 0x900000005;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_playerManager))) + 0xb4)))) = 7;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_playerManager))) + 0xa8)))) = 0xaa17414f;
|
|
(this->_playerManager)._rng._shift1 = 5;
|
|
(this->_playerManager)._rng._shift2 = 9;
|
|
(this->_playerManager)._rng._shift3 = 7;
|
|
(this->_playerManager)._rng._seed = -0x55e8beb1;
|
|
(this->_playerManager)._stageTransitionPlayer = (void *)0x0;
|
|
(this->_playerManager)._roomTransitionPlayer = (void *)0x0;
|
|
(this->_playerManager)._extraPlayers._begin = (void *)0x0;
|
|
(this->_playerManager)._extraPlayers._end = (void *)0x0;
|
|
(this->_playerManager)._extraPlayers._capacity = (void *)0x0;
|
|
memset((this->_playerManager)._coopSlots,0,0x50);
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_playerManager))) + 0x80)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_playerManager))) + 0x84)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_playerManager))) + 0x88)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_playerManager))) + 0x8c)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_playerManager))) + 0x60)))) = 0xffffffff;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_playerManager))) + 0x64)))) = 0xffffffff;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_playerManager))) + 0x68)))) = 0xffffffff;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_playerManager))) + 0x6c)))) = 0xffffffff;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x11;
|
|
Seeds::constructor();
|
|
(this->_onlinePlayerStats)._begin = (void *)0x0;
|
|
(this->_onlinePlayerStats)._end = (void *)0x0;
|
|
(this->_onlinePlayerStats)._capacity = (void *)0x0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x13;
|
|
_eh_vector_constructor_iterator_
|
|
(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1bbec))),0x34,0x15,GHIDRA_CAST<_func_void_void_ptr *>(&LAB_00425360),FUN_00425410);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x14;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1c030))) = 0;
|
|
init_coop_awards(&this->_onlinePlayerStats);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x15;
|
|
(GHIDRA_CAST<ANM2 *>((&(this->_itemOverlay)._sprite)))->ANM2::constructor();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x16;
|
|
_eh_vector_constructor_iterator_
|
|
(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_itemOverlay))) + 0x11c))),0x58,0x30,GHIDRA_CAST<_func_void_void_ptr *>(&LAB_009abcf0),
|
|
FUN_009abd50);
|
|
(this->_itemOverlay)._player = (EntityPtr)0x0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x18;
|
|
(GHIDRA_CAST<ANM2 *>((&(this->_itemOverlay)._megaMushPlayerSprite)))->ANM2::constructor();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x19;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1d2f4)))))))->ANM2::constructor();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x1a;
|
|
_eh_vector_constructor_iterator_
|
|
(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1d408))),0x38,5,GHIDRA_CAST<_func_void_void_ptr *>(&LAB_00420aa0),FUN_00420b00);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x1b;
|
|
*GHIDRA_CAST<undefined4 *>(&this->_gameOver) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_gameOver))) + 0x4)))) = 0;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_gameOver))) + 0x8)))))))->ANM2::constructor();
|
|
(this->_gameOver)._isStopSoundsPending = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1d640)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1d644)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1d648)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1d64c)))) = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x1c;
|
|
Leaderboard::constructor();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x1d;
|
|
(GHIDRA_CAST<HUD *>((&this->_hud)))->HUD::constructor();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x1e;
|
|
(GHIDRA_CAST<PauseScreen *>((&this->_pauseScreen)))->PauseScreen::constructor();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x1f;
|
|
this->_revivePlayerMenu = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x24ed0)))) = 0xffffffff;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x24ed4)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x24ed8)))) = 0;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x24edc)))))))->ANM2::constructor();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x20;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x24ff0)))))))->ANM2::constructor();
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x25104)))) = 0x3f400000;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x21;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x25108))) = 0;
|
|
this->_emoteMenuState = 0;
|
|
(GHIDRA_CAST<OnlineEmotes *>((&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x25110))))))->OnlineEmotes::constructor();
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x258d4)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x258d8)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x258dc)))) = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x23;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x258e0)))) = 0;
|
|
SharedPtrPair::constructor();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x24;
|
|
SharedPtrPair::constructor();
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2593c)))) = 0xffffffff;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x25940)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x25944)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x25948)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2594c)))) = 0x42dc0000;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x25950)))) = 0x428c0000;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x25;
|
|
(this->_onlineStatsScreen)._isActive = 0;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_onlineStatsScreen))) + 0x4)))))))->ANM2::constructor();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x26;
|
|
_eh_vector_constructor_iterator_
|
|
(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_onlineStatsScreen))) + 0x118))),0x114,4,ANM2::constructor,ANM2::~ANM2);
|
|
(this->_onlineStatsScreen)._players._begin = (void *)0x0;
|
|
(this->_onlineStatsScreen)._players._end = (void *)0x0;
|
|
(this->_onlineStatsScreen)._players._capacity = (void *)0x0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x27;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_minimap))) + 0x14)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_minimap))) + 0x10)))) = 0;
|
|
_eh_vector_constructor_iterator_((this->_minimap)._config,0x160,2,FUN_0098b0a0,FUN_0098b130);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x28;
|
|
(GHIDRA_CAST<ANM2 *>((&(this->_minimap)._itemIconsSprite)))->ANM2::constructor();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x29;
|
|
(GHIDRA_CAST<ANM2 *>((&(this->_minimap)._hudPickupSprite)))->ANM2::constructor();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x2a;
|
|
(GHIDRA_CAST<ANM2 *>((&(this->_minimap)._iconsSprite)))->ANM2::constructor();
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_minimap))) + 0x614)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_minimap))) + 0x618)))) = 0;
|
|
(this->_minimap)._shakeOffset.y = 0.0;
|
|
(this->_minimap)._shakeOffset.x = 0.0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x2b;
|
|
(this->_screenShakeOffset).y = 0.0;
|
|
(this->_screenShakeOffset).x = 0.0;
|
|
(GHIDRA_CAST<KAGE::SmartPointer *>((this->_giantBookClickerImage)))->KAGE::SmartPointer::SmartPointer((void *)0x0);
|
|
this->_triggerWindowResize = 0;
|
|
this->_debugFlags = 0;
|
|
this->_gameStateFlags = 0;
|
|
*GHIDRA_CAST<undefined2 *>(&this->_isStarted) = 0;
|
|
(GHIDRA_CAST<KColor *>((&this->_fadeInColor)))->KColor::SetFromARGB(0xffffffff);
|
|
(GHIDRA_CAST<KColor *>((&this->_fadeOutColor)))->KColor::SetFromARGB(0xffffffff);
|
|
this->_framesSinceRoomTransition = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&this->_ambush) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_ambush))) + 0x4)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_ambush))) + 0x8)))) = 0;
|
|
(this->_ambush)._bossRushWaves._begin = (void *)0x0;
|
|
(this->_ambush)._bossRushWaves._end = (void *)0x0;
|
|
(this->_ambush)._bossRushWaves._capacity = (void *)0x0;
|
|
*GHIDRA_CAST<undefined8 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x265f8)))) = 0x900000005;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x265f4)))) = 0xaa17414f;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x26600)))) = 7;
|
|
*GHIDRA_CAST<undefined8 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x26608)))) = 0x900000005;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x26604)))) = 0xaa17414f;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x26610)))) = 7;
|
|
(this->_ambush)._isActive = 0;
|
|
(this->_ambush)._currentWave = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x265f0)))) = 0;
|
|
local_14 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),0x2d);
|
|
*GHIDRA_CAST<undefined4 *>(&this->_deathmatchManager) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_deathmatchManager))) + 0x4)))) = 0;
|
|
(this->_deathmatchManager)._type = (void *)0x0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x26628)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x26624)))) = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2662c))) = 0;
|
|
uVar2 = Random();
|
|
if ((uVar2 & 1) == 0) {
|
|
iVar5 = 1;
|
|
}
|
|
else {
|
|
uVar2 = Random();
|
|
iVar5 = uVar2 % 10 + 2;
|
|
}
|
|
(GHIDRA_CAST<DeathmatchManager *>((&this->_deathmatchManager)))->DeathmatchManager::set_type(iVar5);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x2e;
|
|
(GHIDRA_CAST<ChallengeParams *>((&(this->_dailyChallenge)._params)))->ChallengeParams::ChallengeParams();
|
|
(this->_dailyChallenge)._id = 0;
|
|
(this->_dailyChallenge)._seed = 0;
|
|
(this->_dailyChallenge)._specialDailyId = 0;
|
|
(this->_dailyChallenge)._isPractice = 0;
|
|
(GHIDRA_CAST<ChallengeParam *>((&(this->_dailyChallenge)._params)))->ChallengeParam::Reset();
|
|
(GHIDRA_CAST<ScoreSheet *>((&this->_scoreSheet)))->ScoreSheet::ScoreSheet();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x30;
|
|
(GHIDRA_CAST<ANM2 *>((&(this->_genericPrompt)._sprite)))->ANM2::constructor();
|
|
(this->_genericPrompt)._isOnlineVote = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_genericPrompt))) + 0x114)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_genericPrompt))) + 0x118)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_genericPrompt))) + 0x11c)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_genericPrompt))) + 0x120)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_genericPrompt))) + 0x124)))) = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x31;
|
|
(GHIDRA_CAST<ANM2 *>((&this->_completionWidgetSprite)))->ANM2::constructor();
|
|
this->_encounteredBosses[0] = 0;
|
|
this->_encounteredBosses[1] = 0;
|
|
this->_encounteredBosses[2] = 0;
|
|
this->_encounteredBosses[3] = 0;
|
|
this->_encounteredBosses[4] = 0;
|
|
this->_encounteredBosses[5] = 0;
|
|
this->_encounteredBosses[6] = 0;
|
|
this->_encounteredBosses[7] = 0;
|
|
this->_encounteredBosses[8] = 0;
|
|
this->_encounteredBosses[9] = 0;
|
|
this->_encounteredBosses[10] = 0;
|
|
this->_encounteredBosses[0xb] = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x33;
|
|
this->_isInstantFadeIn = 0;
|
|
_eh_vector_constructor_iterator_
|
|
(this->_glowingHourglassStates,0x20660,2,FUN_006f2970,
|
|
GHIDRA_CAST<_func_void_void_ptr *>(&LAB_006f2990));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x34;
|
|
(this->_currentColorModifier)._red = 1.0;
|
|
(this->_currentColorModifier)._green = 1.0;
|
|
(this->_currentColorModifier)._blue = 1.0;
|
|
(this->_currentColorModifier)._amount = 0.0;
|
|
(this->_currentColorModifier)._brightness = 0.0;
|
|
(this->_currentColorModifier)._contrast = 1.0;
|
|
(this->_targetColorModifier)._red = 1.0;
|
|
(this->_targetColorModifier)._green = 1.0;
|
|
(this->_targetColorModifier)._blue = 1.0;
|
|
(this->_targetColorModifier)._amount = 0.0;
|
|
(this->_targetColorModifier)._brightness = 0.0;
|
|
(this->_targetColorModifier)._contrast = 1.0;
|
|
(this->_lerpColorModifier)._red = 1.0;
|
|
(this->_lerpColorModifier)._green = 1.0;
|
|
(this->_lerpColorModifier)._blue = 1.0;
|
|
(this->_lerpColorModifier)._amount = 0.0;
|
|
(this->_lerpColorModifier)._brightness = 0.0;
|
|
(this->_lerpColorModifier)._contrast = 1.0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x67700)))) = 0x3f800000;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x67704)))) = 0x3f800000;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x67708)))) = 0x3f800000;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x6770c)))) = 0x3f800000;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x67710)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x67714)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x67718)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x6771c)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x67720)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x67724)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x67728)))) = 0;
|
|
this->_debugRenderer = (DebugRenderer)0x0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x67730)))) = 0;
|
|
debugRenderer = (DebugRenderer)operator_new(0x40);
|
|
*GHIDRA_CAST<DebugRenderer *>(debugRenderer) = debugRenderer;
|
|
*GHIDRA_CAST<DebugRenderer *>((GHIDRA_CAST<char *>(debugRenderer) + 4)) = debugRenderer;
|
|
this->_debugRenderer = debugRenderer;
|
|
this->_isRoomRespawned = 0;
|
|
(this->_erasedEntities)._begin = (void *)0x0;
|
|
(this->_erasedEntities)._end = (void *)0x0;
|
|
(this->_erasedEntities)._capacity = (void *)0x0;
|
|
(this->_proceduralItemManager)._proceduralItems._begin = (void *)0x0;
|
|
(this->_proceduralItemManager)._proceduralItems._end = (void *)0x0;
|
|
(this->_proceduralItemManager)._proceduralItems._capacity = (void *)0x0;
|
|
(this->_proceduralItemManager)._renderTarget = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_proceduralItemManager))) + 0x10)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_proceduralItemManager))) + 0x14)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_proceduralItemManager))) + 0x18)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_proceduralItemManager))) + 0x1c)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_proceduralItemManager))) + 0x20)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_proceduralItemManager))) + 0x24)))) = 0;
|
|
spawnTriggerTargets = &(this->_proceduralItemManager)._spawnTriggerTargets;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x3a;
|
|
spawnTriggerTargets->_head = (void *)0x0;
|
|
(this->_proceduralItemManager)._spawnTriggerTargets._size = 0;
|
|
allocation = operator_new(0x18);
|
|
*(void **)allocation = allocation;
|
|
*(void **)(GHIDRA_CAST<char *>(allocation) + 4) = allocation;
|
|
*(void **)(GHIDRA_CAST<char *>(allocation) + 8) = allocation;
|
|
*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(allocation) + 0xc)) = 0x101;
|
|
spawnTriggerTargets->_head = allocation;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x3b;
|
|
_eh_vector_constructor_iterator_(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x6778c))),800,7,FUN_006ef920,FUN_006f29a0);
|
|
this->_isPocketItemRewindSaved = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x68d74)))) = 0;
|
|
this->_console = (Console)0x0;
|
|
this[1]._stageType = 0;
|
|
this[1]._bossChallenge = 0;
|
|
this[1]._devilRoomDisabled = 0;
|
|
*GHIDRA_CAST<undefined2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0xa)))) = 0;
|
|
this[1]._roomList[0].SafeGridIndex = 0;
|
|
this[1]._roomList[0].OverrideData = (void *)0x0;
|
|
this[1]._roomList[0].AllowedDoors = 0xf;
|
|
*GHIDRA_CAST<undefined1 *>(&this[1]._roomList[0].SafeGridIndex) = 0;
|
|
this[1]._roomList[0]._doors[0] = 0;
|
|
this[1]._roomList[0]._doors[1] = 0;
|
|
this[1]._roomList[0]._doors[2] = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x3e;
|
|
piVar1 = this[1]._roomList[0]._doors + 3;
|
|
*piVar1 = 0;
|
|
this[1]._roomList[0]._doors[4] = 0;
|
|
this[1]._roomList[0]._doors[5] = 0;
|
|
this[1]._roomList[0]._doors[6] = 0;
|
|
this[1]._roomList[0]._doors[7] = 0;
|
|
puVar4 = operator_new(8);
|
|
puVar4[1] = 0;
|
|
*piVar1 = GHIDRA_INT(puVar4);
|
|
*puVar4 = piVar1;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x3f;
|
|
piVar1 = &this[1]._roomList[0].DisplayFlags;
|
|
*piVar1 = 0;
|
|
this[1]._roomList[0].VisitedCount = 0;
|
|
this[1]._roomList[0].Flags = 0;
|
|
this[1]._roomList[0].TotalMoneySpent = 0;
|
|
this[1]._roomList[0].ClearCount = 0;
|
|
this[1]._roomList[0].GreedSubType = 0;
|
|
containerProxy = operator_new(8);
|
|
containerProxy[1] = 0;
|
|
*piVar1 = GHIDRA_INT(containerProxy);
|
|
*containerProxy = GHIDRA_INT(piVar1);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x40;
|
|
this[1]._roomList[0].PitsCount = 0;
|
|
this[1]._roomList[0].DecorationSeed = 0;
|
|
this[1]._roomList[0].PoopCount = 0;
|
|
this[1]._roomList[0].TKeeperCoinSpawns = 0;
|
|
_eh_vector_constructor_iterator_
|
|
(&this[1]._roomList[0].SpawnSeed,0x18,6,FUN_0040c380,std::string::_Tidy_deallocate);
|
|
this[1]._roomList[1]._doors[7] = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x41;
|
|
allocation = operator_new(0x6aac60);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x42;
|
|
if (allocation == (void *)0x0) {
|
|
allocation = (void *)0x0;
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<EntityFactory *>((allocation)))->EntityFactory::constructor();
|
|
allocation = extraout_EAX;
|
|
}
|
|
local_14 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),0x41);
|
|
this->_entityFactory = allocation;
|
|
create_render_surfaces();
|
|
(GHIDRA_CAST<ModManager *>((&g_manager->_modManager)))->ModManager::create_shader_render_targets();
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 006f3060
|
|
Game::~Game()
|
|
{
|
|
undefined4 *treeHead;
|
|
char isLastRef;
|
|
int in_ECX;
|
|
undefined4 extraout_ECX;
|
|
undefined4 extraout_ECX_00;
|
|
undefined4 extraout_ECX_01;
|
|
undefined4 extraout_ECX_02;
|
|
undefined4 extraout_ECX_03;
|
|
undefined4 extraout_ECX_04;
|
|
undefined4 extraout_ECX_05;
|
|
undefined4 extraout_ECX_06;
|
|
undefined4 extraout_ECX_07;
|
|
undefined4 extraout_ECX_08;
|
|
undefined4 extraout_ECX_09;
|
|
undefined4 extraout_ECX_10;
|
|
undefined4 extraout_ECX_11;
|
|
undefined4 extraout_ECX_12;
|
|
undefined4 extraout_ECX_13;
|
|
undefined4 extraout_ECX_14;
|
|
undefined4 extraout_ECX_15;
|
|
undefined4 uVar1;
|
|
undefined4 extraout_ECX_16;
|
|
undefined4 extraout_ECX_17;
|
|
undefined4 extraout_ECX_18;
|
|
undefined4 extraout_ECX_19;
|
|
undefined4 extraout_ECX_20;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
void *entityPool;
|
|
Room *room;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00afbb60;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(in_ECX);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_00);
|
|
(GHIDRA_CAST<KAGE::SmartPointer *>((&DAT_00c797c4)))->KAGE::SmartPointer::reset((void *)0x0);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_01);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_02);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_03);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_04);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_05);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_06);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_07);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_08);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_09);
|
|
(GHIDRA_CAST<KAGE::SmartPointer *>((&DAT_00c7983c)))->KAGE::SmartPointer::reset((void *)0x0);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_10);
|
|
(GHIDRA_CAST<KAGE::SmartPointer *>((&DAT_00c79804)))->KAGE::SmartPointer::reset((void *)0x0);
|
|
(GHIDRA_CAST<KAGE::SmartPointer *>((&DAT_00c7980c)))->KAGE::SmartPointer::reset((void *)0x0);
|
|
(GHIDRA_CAST<KAGE::SmartPointer *>((&DAT_00c79814)))->KAGE::SmartPointer::reset((void *)0x0);
|
|
(GHIDRA_CAST<KAGE::SmartPointer *>((&DAT_00c79844)))->KAGE::SmartPointer::reset((void *)0x0);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_11);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_12);
|
|
room = *GHIDRA_CAST<Room **>((in_ECX + 0x18300));
|
|
uVar1 = extraout_ECX_13;
|
|
if (room != GHIDRA_CAST<Room *>(0x0)) {
|
|
(GHIDRA_CAST<Room *>((room)))->Room::~Room();
|
|
operator_delete(room,0x7898);
|
|
*GHIDRA_CAST<undefined4 *>((in_ECX + 0x18300)) = 0;
|
|
uVar1 = extraout_ECX_14;
|
|
}
|
|
entityPool = *(void **)(in_ECX + 0x26580);
|
|
if (entityPool != (void *)0x0) {
|
|
local_8 = 0;
|
|
_eh_vector_destructor_iterator_((void *)(GHIDRA_INT(entityPool) + 0x696458),0x520,0x40,FUN_00960bc0);
|
|
local_8 = 1;
|
|
_eh_vector_destructor_iterator_
|
|
((void *)(GHIDRA_INT(entityPool) + 0x675c50),0x410,0x80,GHIDRA_CAST<_func_void_void_ptr *>(&LAB_006a7f10))
|
|
;
|
|
local_8 = 2;
|
|
_eh_vector_destructor_iterator_
|
|
((void *)(GHIDRA_INT(entityPool) + 0x64c448),0x530,0x80,GHIDRA_CAST<_func_void_void_ptr *>(&LAB_005ccc90))
|
|
;
|
|
local_8 = 3;
|
|
_eh_vector_destructor_iterator_
|
|
((void *)(GHIDRA_INT(entityPool) + 0x460440),0xf60,0x200,Entity_NPC::~Entity_NPC);
|
|
local_8 = 4;
|
|
_eh_vector_destructor_iterator_((void *)(GHIDRA_INT(entityPool) + 0x435c38),0x550,0x80,FUN_0065d160);
|
|
local_8 = 5;
|
|
_eh_vector_destructor_iterator_
|
|
((void *)(GHIDRA_INT(entityPool) + 0x357c30),0x6f0,0x200,Entity_Pickup::~Entity_Pickup);
|
|
local_8 = 6;
|
|
_eh_vector_destructor_iterator_
|
|
((void *)(GHIDRA_INT(entityPool) + 0x32c828),0x568,0x80,Entity_Laser::destructor);
|
|
local_8 = 7;
|
|
_eh_vector_destructor_iterator_
|
|
((void *)(GHIDRA_INT(entityPool) + 0x223820),0x848,0x200,Entity_Tear::~Entity_Tear);
|
|
local_8 = 8;
|
|
_eh_vector_destructor_iterator_
|
|
((void *)(GHIDRA_INT(entityPool) + 0x194818),0x478,0x200,GHIDRA_CAST<_func_void_void_ptr *>(&LAB_00652b80)
|
|
);
|
|
local_8 = 9;
|
|
_eh_vector_destructor_iterator_((void *)(GHIDRA_INT(entityPool) + 0x16d210),0x9d8,0x40,FUN_006a1fc0);
|
|
local_8 = 10;
|
|
_eh_vector_destructor_iterator_((void *)(GHIDRA_INT(entityPool) + 0x130008),0xf48,0x40,FUN_0060d400);
|
|
local_8 = 0xb;
|
|
_eh_vector_destructor_iterator_(entityPool,0x4c0,0x400,FUN_005cda90);
|
|
local_8 = 0xffffffff;
|
|
operator_delete(entityPool,0x6aac60);
|
|
uVar1 = extraout_ECX_15;
|
|
}
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(uVar1);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_16);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_17);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_18);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_19);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_20);
|
|
(GHIDRA_CAST<KAGE::SmartPointer *>(((void *)(in_ECX + 0x26520))))->KAGE::SmartPointer::reset((void *)0x0);
|
|
FUN_008f7dd0();
|
|
(GHIDRA_CAST<Console *>((GHIDRA_CAST<Console *>((in_ECX + 0x68d78)))))->Console::destructor();
|
|
_eh_vector_destructor_iterator_((void *)(in_ECX + 0x6778c),800,7,FUN_006f29a0);
|
|
(GHIDRA_CAST<ProceduralItemManager *>((GHIDRA_CAST<ProceduralItemManager *>((in_ECX + 0x67758)))))->ProceduralItemManager::~ProceduralItemManager();
|
|
std::vector<12byte>::_Tidy();
|
|
FUN_0042f060();
|
|
_eh_vector_destructor_iterator_
|
|
((void *)(in_ECX + 0x269ec),0x20660,2,GHIDRA_CAST<_func_void_void_ptr *>(&LAB_006f2990));
|
|
std::vector<Vector>::_Tidy();
|
|
local_8 = 0xc;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((in_ECX + 0x268ac)))))->ANM2::Reset();
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((in_ECX + 0x268fc)))))->AnimationState::~AnimationState();
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((in_ECX + 0x268dc)))))->AnimationState::~AnimationState();
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>((in_ECX + 0x268c4)))))->std::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>((in_ECX + 0x268ac)))))->std::string::_Tidy_deallocate();
|
|
local_8 = 0xd;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((in_ECX + 0x26778)))))->ANM2::Reset();
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((in_ECX + 0x267c8)))))->AnimationState::~AnimationState();
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((in_ECX + 0x267a8)))))->AnimationState::~AnimationState();
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>((in_ECX + 0x26790)))))->std::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>((in_ECX + 0x26778)))))->std::string::_Tidy_deallocate();
|
|
std::vector<12byte>::_Tidy();
|
|
std::vector<12byte>::_Tidy();
|
|
std::vector<12byte>::_Tidy();
|
|
std::vector<12byte>::_Tidy();
|
|
FUN_004269f0();
|
|
local_8 = 0xe;
|
|
if (*GHIDRA_CAST<undefined4 **>((in_ECX + 0x26620)) != GHIDRA_CAST<undefined4 *>(0x0)) {
|
|
(**(code **)**GHIDRA_CAST<undefined4 **>((in_ECX + 0x26620)))(1);
|
|
*GHIDRA_CAST<undefined4 *>((in_ECX + 0x26620)) = 0;
|
|
}
|
|
FUN_00708c10();
|
|
FUN_00708c10();
|
|
local_8 = 0xf;
|
|
if (*GHIDRA_CAST<int **>((in_ECX + 0x26524)) != GHIDRA_CAST<int *>(0x0)) {
|
|
isLastRef = (**(code **)(**GHIDRA_CAST<int **>((in_ECX + 0x26524)) + 0xc))();
|
|
if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) {
|
|
(*g_imageReleaseFn)((void *)(in_ECX + 0x26520));
|
|
}
|
|
}
|
|
(GHIDRA_CAST<Minimap *>((GHIDRA_CAST<Minimap *>((in_ECX + 0x25ecc)))))->Minimap::~Minimap();
|
|
(GHIDRA_CAST<OnlineStatsScreen *>((GHIDRA_CAST<OnlineStatsScreen *>((in_ECX + 0x25954)))))->OnlineStatsScreen::~OnlineStatsScreen();
|
|
if (*GHIDRA_CAST<char *>((in_ECX + 0x25108)) != '\0') {
|
|
*GHIDRA_CAST<undefined4 *>((in_ECX + 0x2510c)) = 0;
|
|
*GHIDRA_CAST<undefined1 *>((in_ECX + 0x25108)) = 0;
|
|
}
|
|
(GHIDRA_CAST<SharedPtrPair *>(((void *)(in_ECX + 0x25910))))->SharedPtrPair::~SharedPtrPair();
|
|
(GHIDRA_CAST<SharedPtrPair *>(((void *)(in_ECX + 0x258e4))))->SharedPtrPair::~SharedPtrPair();
|
|
std::vector<std::vector<4byte>>::_Tidy();
|
|
(GHIDRA_CAST<OnlineEmotes *>(((void *)(in_ECX + 0x25110))))->OnlineEmotes::destructor();
|
|
(GHIDRA_CAST<RevivePlayerMenu *>(((void *)(in_ECX + 0x24ecc))))->RevivePlayerMenu::~RevivePlayerMenu();
|
|
(GHIDRA_CAST<PauseScreen *>((GHIDRA_CAST<PauseScreen *>((in_ECX + 0x23a74)))))->PauseScreen::~PauseScreen();
|
|
(GHIDRA_CAST<HUD *>((GHIDRA_CAST<HUD *>((in_ECX + 0x1da04)))))->HUD::destructor();
|
|
(GHIDRA_CAST<Leaderboard *>((GHIDRA_CAST<Leaderboard *>((in_ECX + 0x1d650)))))->Leaderboard::~Leaderboard();
|
|
std::vector<56byte_string>::_Tidy();
|
|
local_8 = 0x10;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((in_ECX + 0x1d528)))))->ANM2::Reset();
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((in_ECX + 0x1d578)))))->AnimationState::~AnimationState();
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((in_ECX + 0x1d558)))))->AnimationState::~AnimationState();
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>((in_ECX + 0x1d540)))))->std::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>((in_ECX + 0x1d528)))))->std::string::_Tidy_deallocate();
|
|
local_8 = 0x11;
|
|
_eh_vector_destructor_iterator_((void *)(in_ECX + 0x1d408),0x38,5,FUN_00420b00);
|
|
local_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),0x12);
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((in_ECX + 0x1d2f4)))))->ANM2::Reset();
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((in_ECX + 0x1d344)))))->AnimationState::~AnimationState();
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((in_ECX + 0x1d324)))))->AnimationState::~AnimationState();
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>((in_ECX + 0x1d30c)))))->std::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>((in_ECX + 0x1d2f4)))))->std::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<ItemOverlay *>((GHIDRA_CAST<ItemOverlay *>((in_ECX + 0x1c034)))))->ItemOverlay::~ItemOverlay();
|
|
online_stats_destroy((void *)(in_ECX + 0x1bbe0));
|
|
treeHead = GHIDRA_CAST<undefined4 *>((in_ECX + 0x1bbd8));
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<std::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(treeHead,(fuzzer_allocator<std::_Tree_node<unsigned_int,void*>_> *)treeHead,
|
|
*(_Tree_node<unsigned_int,void*> **)(*GHIDRA_CAST<int *>((in_ECX + 0x1bbd8)) + 4));
|
|
operator_delete((void *)*treeHead,0x14);
|
|
PlayerManager::~PlayerManager();
|
|
(GHIDRA_CAST<RoomTransition *>((GHIDRA_CAST<RoomTransition *>((in_ECX + 0x1b83c)))))->RoomTransition::~RoomTransition();
|
|
local_8 = 0x13;
|
|
FID_conflict__Tidy((void *)(in_ECX + 0x1b82c));
|
|
FID_conflict__Tidy((void *)(in_ECX + 0x1b81c));
|
|
_eh_vector_destructor_iterator_((void *)(in_ECX + 0x1af70),0x3c,0x25,FUN_00421860);
|
|
local_8 = 0x14;
|
|
std::vector<Vector>::_Tidy();
|
|
FID_conflict__Tidy((void *)(in_ECX + 0x1adcc));
|
|
FID_conflict__Tidy((void *)(in_ECX + 0x1adbc));
|
|
_eh_vector_destructor_iterator_
|
|
((void *)(in_ECX + 0x1a744),0x34,0x1f,GHIDRA_CAST<_func_void_void_ptr *>(&LAB_00732c80));
|
|
FUN_00709420(GHIDRA_CAST<undefined4 *>((in_ECX + 0x1a738)),*GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((in_ECX + 0x1a738)) + 4)));
|
|
operator_delete(*(void **)(in_ECX + 0x1a738),0x50);
|
|
(GHIDRA_CAST<RoomConfig *>((GHIDRA_CAST<RoomConfig *>((in_ECX + 0x18910)))))->RoomConfig::~RoomConfig();
|
|
local_8 = 0x15;
|
|
room = *GHIDRA_CAST<Room **>((in_ECX + 0x18300));
|
|
if (room != GHIDRA_CAST<Room *>(0x0)) {
|
|
(GHIDRA_CAST<Room *>((room)))->Room::~Room();
|
|
operator_delete(room,0x7898);
|
|
*GHIDRA_CAST<undefined4 *>((in_ECX + 0x18300)) = 0;
|
|
}
|
|
std::vector<RoomEntry>::_Tidy();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x16;
|
|
if (*GHIDRA_CAST<int **>((in_ECX + 0x182fc)) != GHIDRA_CAST<int *>(0x0)) {
|
|
isLastRef = (**(code **)(**GHIDRA_CAST<int **>((in_ECX + 0x182fc)) + 0xc))();
|
|
if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) {
|
|
(*g_imageReleaseFn)(in_ECX + 0x182f8);
|
|
}
|
|
}
|
|
local_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),0x15);
|
|
_eh_vector_destructor_iterator_((void *)(in_ECX + 0x14),0xb8,0x20f,RoomDescriptor::destructor);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 006f37e0
|
|
void Game::create_render_surfaces()
|
|
{
|
|
char isLastRef;
|
|
uint uVar1;
|
|
void *newTarget;
|
|
KColor *clearColor;
|
|
KColor *clearColor_00;
|
|
KColor *clearColor_01;
|
|
KColor *clearColor_02;
|
|
KColor *clearColor_03;
|
|
KColor *clearColor_04;
|
|
KColor transparentColor;
|
|
undefined1 colormodTarget [4];
|
|
int *colormodTargetRefCount;
|
|
undefined1 tmpTarget [4];
|
|
int *tmpTargetRefCount;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
int *surface;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00afbbb5;
|
|
local_10 = ExceptionList;
|
|
uVar1 = __security_cookie ^ GHIDRA_UINT((tmpTarget + 0x14));
|
|
ExceptionList = &local_10;
|
|
if (DAT_00c79758 == GHIDRA_CAST<int *>(0x0)) {
|
|
(GHIDRA_CAST<KColor *>((&transparentColor)))->KColor::SetFromARGB(0);
|
|
newTarget = KAGE_Graphics::create_render_target
|
|
(tmpTarget,g_framebufferWidth,DAT_00c79114,GHIDRA_CAST<byte *>("Pixelation Surface"),
|
|
clearColor);
|
|
local_8 = 0;
|
|
(GHIDRA_CAST<shared_ptr *>((&DAT_00c79758)))->shared_ptr::operator_assign(newTarget);
|
|
local_8 = 1;
|
|
if (tmpTargetRefCount != GHIDRA_CAST<int *>(0x0)) {
|
|
isLastRef = (**(code **)(*tmpTargetRefCount + 0xc))(uVar1);
|
|
if ((isLastRef != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) {
|
|
(*g_renderTargetReleaseFn)(tmpTarget);
|
|
}
|
|
}
|
|
surface = DAT_00c79758;
|
|
local_8 = 0xffffffff;
|
|
if ((DAT_00c79758[0xe] != 1) || (DAT_00c79758[0xf] != 1)) {
|
|
(**(code **)(*DAT_00c79758 + 0x48))(1,1);
|
|
surface[0xe] = 1;
|
|
surface[0xf] = 1;
|
|
}
|
|
}
|
|
if ((DAT_00c79774 == GHIDRA_CAST<int *>(0x0)) && ((g_manager->_optionsConfig)._enableBloom != 0)) {
|
|
(GHIDRA_CAST<KColor *>((&transparentColor)))->KColor::SetFromARGB(0);
|
|
newTarget = KAGE_Graphics::create_render_target
|
|
(tmpTarget,g_framebufferWidth,DAT_00c79114,GHIDRA_CAST<byte *>("Bloom Surface"),
|
|
clearColor_00);
|
|
local_8 = 2;
|
|
(GHIDRA_CAST<shared_ptr *>((&DAT_00c79774)))->shared_ptr::operator_assign(newTarget);
|
|
local_8 = 3;
|
|
if (tmpTargetRefCount != GHIDRA_CAST<int *>(0x0)) {
|
|
isLastRef = (**(code **)(*tmpTargetRefCount + 0xc))();
|
|
if ((isLastRef != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) {
|
|
(*g_renderTargetReleaseFn)(tmpTarget);
|
|
}
|
|
}
|
|
surface = DAT_00c79774;
|
|
local_8 = 0xffffffff;
|
|
if ((DAT_00c79774[0xe] != 1) || (DAT_00c79774[0xf] != 1)) {
|
|
(**(code **)(*DAT_00c79774 + 0x48))(1,1);
|
|
surface[0xe] = 1;
|
|
surface[0xf] = 1;
|
|
}
|
|
}
|
|
if (DAT_00c79794 == GHIDRA_CAST<int *>(0x0)) {
|
|
(GHIDRA_CAST<KColor *>((&transparentColor)))->KColor::SetFromARGB(0);
|
|
newTarget = KAGE_Graphics::create_render_target
|
|
(tmpTarget,g_framebufferWidth,DAT_00c79114,GHIDRA_CAST<byte *>("Old TV Surface"),
|
|
clearColor_01);
|
|
local_8 = 4;
|
|
(GHIDRA_CAST<shared_ptr *>((&DAT_00c79794)))->shared_ptr::operator_assign(newTarget);
|
|
local_8 = 5;
|
|
if (tmpTargetRefCount != GHIDRA_CAST<int *>(0x0)) {
|
|
isLastRef = (**(code **)(*tmpTargetRefCount + 0xc))();
|
|
if ((isLastRef != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) {
|
|
(*g_renderTargetReleaseFn)(tmpTarget);
|
|
}
|
|
}
|
|
surface = DAT_00c79794;
|
|
local_8 = 0xffffffff;
|
|
if ((DAT_00c79794[0xe] != 1) || (DAT_00c79794[0xf] != 1)) {
|
|
(**(code **)(*DAT_00c79794 + 0x48))(1,1);
|
|
surface[0xe] = 1;
|
|
surface[0xf] = 1;
|
|
}
|
|
}
|
|
if (DAT_00c7979c == GHIDRA_CAST<int *>(0x0)) {
|
|
(GHIDRA_CAST<KColor *>((&transparentColor)))->KColor::SetFromARGB(0);
|
|
newTarget = KAGE_Graphics::create_render_target
|
|
(tmpTarget,g_framebufferWidth,DAT_00c79114,GHIDRA_CAST<byte *>("Hallucination Surface")
|
|
,clearColor_02);
|
|
local_8 = 6;
|
|
(GHIDRA_CAST<shared_ptr *>((&DAT_00c7979c)))->shared_ptr::operator_assign(newTarget);
|
|
local_8 = 7;
|
|
if (tmpTargetRefCount != GHIDRA_CAST<int *>(0x0)) {
|
|
isLastRef = (**(code **)(*tmpTargetRefCount + 0xc))();
|
|
if ((isLastRef != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) {
|
|
(*g_renderTargetReleaseFn)(tmpTarget);
|
|
}
|
|
}
|
|
surface = DAT_00c7979c;
|
|
local_8 = 0xffffffff;
|
|
if ((DAT_00c7979c[0xe] != 1) || (DAT_00c7979c[0xf] != 1)) {
|
|
(**(code **)(*DAT_00c7979c + 0x48))(1,1);
|
|
surface[0xe] = 1;
|
|
surface[0xf] = 1;
|
|
}
|
|
}
|
|
if (DAT_00c797a4 == GHIDRA_CAST<int *>(0x0)) {
|
|
(GHIDRA_CAST<KColor *>((&transparentColor)))->KColor::SetFromARGB(0);
|
|
newTarget = KAGE_Graphics::create_render_target
|
|
(tmpTarget,g_framebufferWidth,DAT_00c79114,
|
|
GHIDRA_CAST<byte *>("Hallucination Snapshot"),clearColor_03);
|
|
local_8 = 8;
|
|
(GHIDRA_CAST<shared_ptr *>((&DAT_00c797a4)))->shared_ptr::operator_assign(newTarget);
|
|
local_8 = 9;
|
|
if (tmpTargetRefCount != GHIDRA_CAST<int *>(0x0)) {
|
|
isLastRef = (**(code **)(*tmpTargetRefCount + 0xc))();
|
|
if ((isLastRef != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) {
|
|
(*g_renderTargetReleaseFn)(tmpTarget);
|
|
}
|
|
}
|
|
surface = DAT_00c797a4;
|
|
local_8 = 0xffffffff;
|
|
if ((DAT_00c797a4[0xe] != 1) || (DAT_00c797a4[0xf] != 1)) {
|
|
(**(code **)(*DAT_00c797a4 + 0x48))(1,1);
|
|
surface[0xe] = 1;
|
|
surface[0xf] = 1;
|
|
}
|
|
}
|
|
if (DAT_00c797ac == GHIDRA_CAST<int *>(0x0)) {
|
|
(GHIDRA_CAST<KColor *>((&transparentColor)))->KColor::SetFromARGB(0);
|
|
newTarget = KAGE_Graphics::create_render_target
|
|
(colormodTarget,g_framebufferWidth,DAT_00c79114,GHIDRA_CAST<byte *>("Colormod Surface")
|
|
,clearColor_04);
|
|
local_8 = 10;
|
|
(GHIDRA_CAST<shared_ptr *>((&DAT_00c797ac)))->shared_ptr::operator_assign(newTarget);
|
|
local_8 = 0xb;
|
|
if (colormodTargetRefCount != GHIDRA_CAST<int *>(0x0)) {
|
|
isLastRef = (**(code **)(*colormodTargetRefCount + 0xc))();
|
|
if ((isLastRef != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) {
|
|
(*g_renderTargetReleaseFn)(colormodTarget);
|
|
}
|
|
}
|
|
surface = DAT_00c797ac;
|
|
local_8 = 0xffffffff;
|
|
if ((DAT_00c797ac[0xe] != 1) || (DAT_00c797ac[0xf] != 1)) {
|
|
(**(code **)(*DAT_00c797ac + 0x48))(1,1);
|
|
surface[0xe] = 1;
|
|
surface[0xf] = 1;
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 006f3c00
|
|
void Game::ReloadStagesXmlOnLuaReset()
|
|
{
|
|
EntityConfig *this;
|
|
byte bVar1;
|
|
byte *extraout_EAX;
|
|
byte *extraout_EAX_00;
|
|
byte *stagePathChars;
|
|
byte *extraout_EAX_01;
|
|
byte *extraout_EAX_02;
|
|
char *anm2PathBuf;
|
|
undefined4 extraout_ECX;
|
|
void *freePtr;
|
|
uint freeSize;
|
|
void *redirectedPathB [4];
|
|
uint redirectedPathBSize;
|
|
uint redirectedPathBCapacity;
|
|
void *redirectedPathA [4];
|
|
uint redirectedPathASize;
|
|
uint redirectedPathACapacity;
|
|
std_string fileName;
|
|
uint local_24;
|
|
undefined1 *puStack_20;
|
|
void *local_1c;
|
|
undefined1 *puStack_18;
|
|
void *local_14;
|
|
Game *temp_3f7f10adfc;
|
|
|
|
temp_3f7f10adfc = g_game;
|
|
puStack_20 = GHIDRA_CAST<undefined1 *>((redirectedPathA + 0x14));
|
|
puStack_18 = &LAB_00afbc2d;
|
|
local_1c = ExceptionList;
|
|
local_24 = __security_cookie ^ GHIDRA_UINT((redirectedPathA + 0x11));
|
|
ExceptionList = &local_1c;
|
|
fileName._capacity = 0xf;
|
|
fileName._size = 10;
|
|
builtin_strncpy(fileName._buf,"stages.x",8);
|
|
fileName._buf[8] = 'm';
|
|
fileName._buf[9] = 'l';
|
|
fileName._buf[10] = '\0';
|
|
local_14 = (void *)0x0;
|
|
(GHIDRA_CAST<ModManager *>((&g_manager->_modManager)))->ModManager::TryRedirectPath(GHIDRA_CAST<std_string *>(redirectedPathA),&fileName);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 1;
|
|
stagePathChars = extraout_EAX;
|
|
if (0xf < *GHIDRA_CAST<uint *>((extraout_EAX + 0x14))) {
|
|
stagePathChars = *GHIDRA_CAST<byte **>(extraout_EAX);
|
|
}
|
|
(GHIDRA_CAST<RoomConfig *>((&temp_3f7f10adfc->_roomConfig)))->RoomConfig::LoadStagesXml(stagePathChars);
|
|
local_14 = (void *)((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8);
|
|
if (0xf < redirectedPathACapacity) {
|
|
freeSize = redirectedPathACapacity + 1;
|
|
freePtr = redirectedPathA[0];
|
|
if (0xfff < freeSize) {
|
|
freePtr = *(void **)(GHIDRA_INT(redirectedPathA[0]) + -4);
|
|
freeSize = redirectedPathACapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(redirectedPathA[0]) + (-4 - GHIDRA_INT(freePtr))))) goto LAB_006f3d18;
|
|
}
|
|
operator_delete(freePtr,freeSize);
|
|
}
|
|
local_14 = (void *)0xffffffff;
|
|
redirectedPathASize = 0;
|
|
redirectedPathACapacity = 0xf;
|
|
redirectedPathA[0] = (void *)(GHIDRA_UINT(redirectedPathA[0]) & 0xffffff00);
|
|
if (0xf < fileName._capacity) {
|
|
freeSize = fileName._capacity + 1;
|
|
freePtr = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)fileName._buf)) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
freePtr = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + -4);
|
|
freeSize = fileName._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + (-4 - GHIDRA_INT(freePtr))))) {
|
|
LAB_006f3d18:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freePtr,freeSize);
|
|
}
|
|
fileName._capacity = 0xf;
|
|
fileName._size = 10;
|
|
builtin_strncpy(fileName._buf,"curses.x",8);
|
|
fileName._buf[8] = 'm';
|
|
fileName._buf[9] = 'l';
|
|
fileName._buf[10] = '\0';
|
|
local_14 = (void *)0x2;
|
|
(GHIDRA_CAST<ModManager *>((&g_manager->_modManager)))->ModManager::TryRedirectPath(GHIDRA_CAST<std_string *>(redirectedPathB),&fileName);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 3;
|
|
stagePathChars = extraout_EAX_00;
|
|
if (0xf < *GHIDRA_CAST<uint *>((extraout_EAX_00 + 0x14))) {
|
|
stagePathChars = *GHIDRA_CAST<byte **>(extraout_EAX_00);
|
|
}
|
|
(GHIDRA_CAST<RoomConfig *>((&temp_3f7f10adfc->_roomConfig)))->RoomConfig::LoadCursesXml(stagePathChars,0);
|
|
local_14 = (void *)CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),2);
|
|
if (0xf < redirectedPathBCapacity) {
|
|
freeSize = redirectedPathBCapacity + 1;
|
|
freePtr = redirectedPathB[0];
|
|
if (0xfff < freeSize) {
|
|
freePtr = *(void **)(GHIDRA_INT(redirectedPathB[0]) + -4);
|
|
freeSize = redirectedPathBCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(redirectedPathB[0]) + (-4 - GHIDRA_INT(freePtr))))) goto LAB_006f3dfe;
|
|
}
|
|
operator_delete(freePtr,freeSize);
|
|
}
|
|
local_14 = (void *)0xffffffff;
|
|
redirectedPathBSize = 0;
|
|
redirectedPathBCapacity = 0xf;
|
|
redirectedPathB[0] = (void *)(GHIDRA_UINT(redirectedPathB[0]) & 0xffffff00);
|
|
if (0xf < fileName._capacity) {
|
|
freeSize = fileName._capacity + 1;
|
|
freePtr = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)fileName._buf)) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
freePtr = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + -4);
|
|
freeSize = fileName._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + (-4 - GHIDRA_INT(freePtr))))) {
|
|
LAB_006f3dfe:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freePtr,freeSize);
|
|
}
|
|
builtin_strncpy(fileName._buf,"minibosses.xml",0xf);
|
|
fileName._capacity = 0xf;
|
|
fileName._size = 0xe;
|
|
local_14 = (void *)0x4;
|
|
(GHIDRA_CAST<ModManager *>((&g_manager->_modManager)))->ModManager::TryRedirectPath(GHIDRA_CAST<std_string *>(redirectedPathA),&fileName);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 5;
|
|
stagePathChars = extraout_EAX_01;
|
|
if (0xf < *GHIDRA_CAST<uint *>((extraout_EAX_01 + 0x14))) {
|
|
stagePathChars = *GHIDRA_CAST<byte **>(extraout_EAX_01);
|
|
}
|
|
LoadMinibossesXml(GHIDRA_CAST<Game *>(&temp_3f7f10adfc->_roomConfig),stagePathChars);
|
|
local_14 = (void *)CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),4);
|
|
if (0xf < redirectedPathACapacity) {
|
|
freeSize = redirectedPathACapacity + 1;
|
|
freePtr = redirectedPathA[0];
|
|
if (0xfff < freeSize) {
|
|
freePtr = *(void **)(GHIDRA_INT(redirectedPathA[0]) + -4);
|
|
freeSize = redirectedPathACapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(redirectedPathA[0]) + (-4 - GHIDRA_INT(freePtr))))) goto LAB_006f3eea;
|
|
}
|
|
operator_delete(freePtr,freeSize);
|
|
}
|
|
local_14 = (void *)0xffffffff;
|
|
redirectedPathASize = 0;
|
|
redirectedPathACapacity = 0xf;
|
|
redirectedPathA[0] = (void *)(GHIDRA_UINT(redirectedPathA[0]) & 0xffffff00);
|
|
if (0xf < fileName._capacity) {
|
|
freeSize = fileName._capacity + 1;
|
|
freePtr = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)fileName._buf)) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
freePtr = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + -4);
|
|
freeSize = fileName._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + (-4 - GHIDRA_INT(freePtr))))) {
|
|
LAB_006f3eea:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freePtr,freeSize);
|
|
}
|
|
fileName._capacity = 0xf;
|
|
fileName._size = 0xb;
|
|
this = &g_manager->_entityConfig;
|
|
builtin_strncpy(fileName._buf,"players.xml",0xc);
|
|
local_14 = (void *)0x6;
|
|
(GHIDRA_CAST<ModManager *>((&g_manager->_modManager)))->ModManager::TryRedirectPath(GHIDRA_CAST<std_string *>(redirectedPathB),&fileName);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 7;
|
|
stagePathChars = extraout_EAX_02;
|
|
if (0xf < *GHIDRA_CAST<uint *>((extraout_EAX_02 + 0x14))) {
|
|
stagePathChars = *GHIDRA_CAST<byte **>(extraout_EAX_02);
|
|
}
|
|
this->EntityConfig::load_players_xml(stagePathChars,(void *)0x0);
|
|
local_14 = (void *)CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),6);
|
|
if (0xf < redirectedPathBCapacity) {
|
|
freeSize = redirectedPathBCapacity + 1;
|
|
freePtr = redirectedPathB[0];
|
|
if (0xfff < freeSize) {
|
|
freePtr = *(void **)(GHIDRA_INT(redirectedPathB[0]) + -4);
|
|
freeSize = redirectedPathBCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(redirectedPathB[0]) + (-4 - GHIDRA_INT(freePtr))))) goto LAB_006f3fd9;
|
|
}
|
|
operator_delete(freePtr,freeSize);
|
|
}
|
|
local_14 = (void *)0xffffffff;
|
|
redirectedPathBSize = 0;
|
|
redirectedPathBCapacity = 0xf;
|
|
redirectedPathB[0] = (void *)(GHIDRA_UINT(redirectedPathB[0]) & 0xffffff00);
|
|
if (0xf < fileName._capacity) {
|
|
freeSize = fileName._capacity + 1;
|
|
freePtr = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)fileName._buf)) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
freePtr = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + -4);
|
|
freeSize = fileName._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + (-4 - GHIDRA_INT(freePtr))))) {
|
|
LAB_006f3fd9:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freePtr,freeSize);
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>(&temp_3f7f10adfc->_gameOver) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((temp_3f7f10adfc->_gameOver))) + 0x4)))) = 0;
|
|
(temp_3f7f10adfc->_gameOver)._isStopSoundsPending = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((temp_3f7f10adfc)) + 0x1d64c)))) = 0;
|
|
(GHIDRA_CAST<ScoreSheet *>((GHIDRA_CAST<ScoreSheet *>(&temp_3f7f10adfc->_leaderboard))))->ScoreSheet::LoadAnm2();
|
|
(GHIDRA_CAST<HUD *>((&temp_3f7f10adfc->_hud)))->HUD::LoadGraphics();
|
|
(GHIDRA_CAST<PauseScreen *>((&temp_3f7f10adfc->_pauseScreen)))->PauseScreen::Init();
|
|
(GHIDRA_CAST<RevivePlayerMenu *>((&temp_3f7f10adfc->_revivePlayerMenu)))->RevivePlayerMenu::Init();
|
|
(GHIDRA_CAST<GenericPrompt *>((&temp_3f7f10adfc->_genericPrompt)))->GenericPrompt::Initialize(0);
|
|
VictoryRunPrompt::Load(extraout_ECX);
|
|
fileName._size = 0;
|
|
fileName._capacity = 0xf;
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) = (*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) & 0xffffffff00000000;
|
|
anm2PathBuf = std::_Allocate(0x20);
|
|
fileName._size = 0x1d;
|
|
fileName._capacity = 0x1f;
|
|
builtin_strncpy(anm2PathBuf,"gfx/ui/completion_widget.anm2",0x1e);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) = anm2PathBuf;
|
|
local_14 = (void *)0x8;
|
|
(GHIDRA_CAST<ANM2 *>((&temp_3f7f10adfc->_completionWidgetSprite)))->ANM2::Load(&fileName,1);
|
|
local_14 = (void *)0xffffffff;
|
|
if (0xf < fileName._capacity) {
|
|
freeSize = fileName._capacity + 1;
|
|
freePtr = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)fileName._buf)) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
freePtr = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + -4);
|
|
freeSize = fileName._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + (-4 - GHIDRA_INT(freePtr))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freePtr,freeSize);
|
|
}
|
|
fileName._size = 0;
|
|
fileName._capacity = 0xf;
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) = (*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) & 0xffffffffffffff00;
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((&temp_3f7f10adfc->_completionWidgetSprite)))->ANM2::SetAnimation(s_Idle,1);
|
|
if ((bVar1 != 0) &&
|
|
((temp_3f7f10adfc->_completionWidgetSprite)._animState._animData != (void *)0x0)) {
|
|
(GHIDRA_CAST<AnimationState *>((&(temp_3f7f10adfc->_completionWidgetSprite)._animState)))->AnimationState::SetFrameFloat(0.0);
|
|
if ((temp_3f7f10adfc->_completionWidgetSprite)._animState._animData != (void *)0x0) {
|
|
(temp_3f7f10adfc->_completionWidgetSprite)._animState._isPlaying = 0;
|
|
}
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 006f43b0
|
|
void Game::reset_run_state()
|
|
{
|
|
void *erasedEntitiesBegin;
|
|
|
|
this->_isRerun = 0;
|
|
this->_isDebug = 0;
|
|
this->_frameCount = 0;
|
|
this->_timeCounter = 0;
|
|
this->_screenShakeTimer = 0;
|
|
ResetState(this);
|
|
this->_freezeFrames = 0;
|
|
(this->_fadeInColor)._red = 0.0;
|
|
(this->_fadeInColor)._green = 0.0;
|
|
(this->_fadeInColor)._blue = 0.0;
|
|
(this->_fadeInColor)._alpha = 0.0;
|
|
this->_debugFlags = 0;
|
|
(this->_fadeOutColor)._red = 0.0;
|
|
(this->_fadeOutColor)._green = 0.0;
|
|
(this->_fadeOutColor)._blue = 0.0;
|
|
(this->_fadeOutColor)._alpha = 0.0;
|
|
this->_debugCurses = 0;
|
|
(this->_fadeInColor)._unk = 0;
|
|
(this->_fadeOutColor)._unk = 0;
|
|
this->_fadeOutTarget = 0;
|
|
this->_restartHoldFrames = 0;
|
|
this->_framesSinceRoomTransition = 0;
|
|
(this->_dailyChallenge)._id = 0;
|
|
(this->_dailyChallenge)._seed = 0;
|
|
(this->_dailyChallenge)._specialDailyId = 0;
|
|
(this->_dailyChallenge)._isPractice = 0;
|
|
(GHIDRA_CAST<ChallengeParam *>((&(this->_dailyChallenge)._params)))->ChallengeParam::Reset();
|
|
ScoreSheet::Reset();
|
|
(this->_currentColorModifier)._red = 1.0;
|
|
(this->_currentColorModifier)._green = 1.0;
|
|
(this->_currentColorModifier)._blue = 1.0;
|
|
(this->_currentColorModifier)._amount = 0.0;
|
|
this->_pixelationDuration = 0;
|
|
this->_pixelationTimer = 0;
|
|
this->_isStartingFromState = 0;
|
|
this->_shouldLerpColorModState = 0;
|
|
(this->_currentColorModifier)._brightness = 0.0;
|
|
(this->_currentColorModifier)._contrast = 1.0;
|
|
erasedEntitiesBegin = (this->_erasedEntities)._begin;
|
|
this->_lightningIntensity = 0.0;
|
|
this->_dizzyIntensity = 0.0;
|
|
this->_dizzyTargetIntensity = 0.0;
|
|
this->_dizzyIntensityChangeSpeed = 0.001;
|
|
this->_isRoomRespawned = 0;
|
|
this->_magicSkinUses = 0;
|
|
(this->_erasedEntities)._end = erasedEntitiesBegin;
|
|
this->_isPocketItemRewindSaved = 0;
|
|
return;
|
|
}
|
|
|
|
// 006f4520
|
|
void Game::ResetState()
|
|
{
|
|
this->_lastDevilRoomStage = 0;
|
|
this->_treasureRoomsVisited = 0;
|
|
this->_planetariumsVisited = 0;
|
|
this->_stagesWithoutHeartsPicked = 0;
|
|
this->_stagesWithoutDamage = 0;
|
|
this->_devilRoomDeals = 0;
|
|
this->_donationModGreed = 0;
|
|
this->_donationModAngel = 0;
|
|
this->_lastLevelWithoutHalfHp = 0;
|
|
this->_isRoomSnapshotTaken = 0;
|
|
this->_shopVisits = 0;
|
|
this->_bloomTimer = 0;
|
|
this->_bloomDuration = 0x1e;
|
|
this->_bloomStrength = 1.0;
|
|
this->_hallucinationDuration = 0;
|
|
this->_hallucinationTimer = 0;
|
|
this->_framesSinceRoomTransition = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&this->_gameStateFlags) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&this->_gameStateFlags) + 4)) = 0;
|
|
this->_ascentTimer = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x67aa8))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x67a9c)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x67aa0)))) = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x67dc8))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x67dbc)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x67dc0)))) = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x680e8))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x680dc)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x680e0)))) = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x68408))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x683fc)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x68400)))) = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x68728))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x6871c)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x68720)))) = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x68a48))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x68a3c)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x68a40)))) = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x68d68))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x68d5c)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x68d60)))) = 0;
|
|
this->_deathCertificateExitTimer = 0;
|
|
this->_darknessTimeout = 0;
|
|
this->_darknessModifier = 0.0;
|
|
this->_darknessStrength = 0.0;
|
|
this->_stageNameNumeral = 1;
|
|
this->_victoryLap = 0;
|
|
this->_lastLevelWithDamage = 0;
|
|
*GHIDRA_CAST<undefined4 *>((this->_encounteredBosses + 4)) = *GHIDRA_CAST<undefined4 *>(this->_encounteredBosses);
|
|
this->_isStoringGlowingHourglassState = 0;
|
|
this->_isRestoringGlowingHourglassState = 0;
|
|
this->_currentGlowingHourglassSlot = -1;
|
|
this->_rewindsThisFloor = 0;
|
|
this->_glowingHourglassStates[0]._isUsable = 0;
|
|
this->_glowingHourglassStates[1]._isUsable = 0;
|
|
this->_isPocketItemRewindSaved = 0;
|
|
this->_reviveMachineUses = 0;
|
|
this->_reviveMachineCoinsLeft = 10;
|
|
return;
|
|
}
|
|
|
|
// 006f4740
|
|
void Game::LoadConfigXmls()
|
|
{
|
|
Game *pGVar1;
|
|
byte isIdleSet;
|
|
char isReleased;
|
|
byte *extraout_EAX;
|
|
byte *extraout_EAX_00;
|
|
byte *stagesPath;
|
|
byte *extraout_EAX_01;
|
|
byte *extraout_EAX_02;
|
|
char *longNameBuf;
|
|
undefined4 *extraout_EAX_03;
|
|
undefined4 *extraout_EAX_04;
|
|
undefined4 *puVar2;
|
|
byte *extraout_EAX_05;
|
|
void *pvVar3;
|
|
undefined4 extraout_ECX;
|
|
uint uVar4;
|
|
int entriesLeft;
|
|
undefined1 loadedImage [4];
|
|
int *loadedImageRefCount;
|
|
void *local_6c [4];
|
|
uint local_5c;
|
|
uint local_58;
|
|
std_string tmpPath;
|
|
std_string tmpName;
|
|
uint local_24;
|
|
undefined1 *puStack_20;
|
|
void *local_1c;
|
|
undefined1 *puStack_18;
|
|
void *local_14;
|
|
int *clickerImage;
|
|
Manager *manager;
|
|
|
|
pGVar1 = g_game;
|
|
puStack_20 = GHIDRA_CAST<undefined1 *>((local_6c + 0x1a));
|
|
local_14 = (void *)0xffffffff;
|
|
puStack_18 = &LAB_00afbd65;
|
|
local_1c = ExceptionList;
|
|
local_24 = __security_cookie ^ GHIDRA_UINT((local_6c + 0x17));
|
|
ExceptionList = &local_1c;
|
|
reset_run_state(g_game);
|
|
manager = g_manager;
|
|
pGVar1->_challenge = 0;
|
|
pGVar1->_isRerun = 0;
|
|
(pGVar1->_screenShakeOffset).x = g_vectorZero.x;
|
|
(pGVar1->_screenShakeOffset).y = g_vectorZero.y;
|
|
pGVar1->_isPocketItemRewindSaved = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pGVar1)) + 0x68d74)))) = 0;
|
|
tmpName._capacity = 0xf;
|
|
tmpName._size = 10;
|
|
builtin_strncpy(tmpName._buf,"stages.x",8);
|
|
tmpName._buf[8] = 'm';
|
|
tmpName._buf[9] = 'l';
|
|
tmpName._buf[10] = '\0';
|
|
local_14 = (void *)0x0;
|
|
(GHIDRA_CAST<ModManager *>((&manager->_modManager)))->ModManager::TryRedirectPath(GHIDRA_CAST<std_string *>(local_6c),&tmpName);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 1;
|
|
stagesPath = extraout_EAX;
|
|
if (0xf < *GHIDRA_CAST<uint *>((extraout_EAX + 0x14))) {
|
|
stagesPath = *GHIDRA_CAST<byte **>(extraout_EAX);
|
|
}
|
|
(GHIDRA_CAST<RoomConfig *>((&pGVar1->_roomConfig)))->RoomConfig::LoadStagesXml(stagesPath);
|
|
local_14 = (void *)((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8);
|
|
if (0xf < local_58) {
|
|
uVar4 = local_58 + 1;
|
|
pvVar3 = local_6c[0];
|
|
if (0xfff < uVar4) {
|
|
pvVar3 = *(void **)(GHIDRA_INT(local_6c[0]) + -4);
|
|
uVar4 = local_58 + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(local_6c[0]) + (-4 - GHIDRA_INT(pvVar3))))) goto LAB_006f48a1;
|
|
}
|
|
operator_delete(pvVar3,uVar4);
|
|
}
|
|
local_14 = (void *)0xffffffff;
|
|
local_5c = 0;
|
|
local_58 = 0xf;
|
|
local_6c[0] = (void *)(GHIDRA_UINT(local_6c[0]) & 0xffffff00);
|
|
if (0xf < tmpName._capacity) {
|
|
uVar4 = tmpName._capacity + 1;
|
|
pvVar3 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)tmpName._buf)) + 0x0)));
|
|
if (0xfff < uVar4) {
|
|
pvVar3 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpName._buf)) + 0x0))) + -4);
|
|
uVar4 = tmpName._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpName._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar3))))) {
|
|
LAB_006f48a1:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar3,uVar4);
|
|
}
|
|
tmpName._capacity = 0xf;
|
|
tmpName._size = 10;
|
|
builtin_strncpy(tmpName._buf,"curses.x",8);
|
|
tmpName._buf[8] = 'm';
|
|
tmpName._buf[9] = 'l';
|
|
tmpName._buf[10] = '\0';
|
|
local_14 = (void *)0x2;
|
|
(GHIDRA_CAST<ModManager *>((&g_manager->_modManager)))->ModManager::TryRedirectPath(&tmpPath,&tmpName);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 3;
|
|
stagesPath = extraout_EAX_00;
|
|
if (0xf < *GHIDRA_CAST<uint *>((extraout_EAX_00 + 0x14))) {
|
|
stagesPath = *GHIDRA_CAST<byte **>(extraout_EAX_00);
|
|
}
|
|
(GHIDRA_CAST<RoomConfig *>((&pGVar1->_roomConfig)))->RoomConfig::LoadCursesXml(stagesPath,0);
|
|
local_14 = (void *)CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),2);
|
|
if (0xf < tmpPath._capacity) {
|
|
uVar4 = tmpPath._capacity + 1;
|
|
pvVar3 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)tmpPath._buf)) + 0x0)));
|
|
if (0xfff < uVar4) {
|
|
pvVar3 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpPath._buf)) + 0x0))) + -4);
|
|
uVar4 = tmpPath._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar3))))) goto LAB_006f4987;
|
|
}
|
|
operator_delete(pvVar3,uVar4);
|
|
}
|
|
local_14 = (void *)0xffffffff;
|
|
tmpPath._size = 0;
|
|
tmpPath._capacity = 0xf;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpPath._buf)) + 0x0))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpPath._buf)) + 0x0))) & 0xffffff00;
|
|
if (0xf < tmpName._capacity) {
|
|
uVar4 = tmpName._capacity + 1;
|
|
pvVar3 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)tmpName._buf)) + 0x0)));
|
|
if (0xfff < uVar4) {
|
|
pvVar3 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpName._buf)) + 0x0))) + -4);
|
|
uVar4 = tmpName._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpName._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar3))))) {
|
|
LAB_006f4987:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar3,uVar4);
|
|
}
|
|
ModManager::LoadModCurses();
|
|
builtin_strncpy(tmpName._buf,"minibosses.xml",0xf);
|
|
tmpName._capacity = 0xf;
|
|
tmpName._size = 0xe;
|
|
local_14 = (void *)0x4;
|
|
(GHIDRA_CAST<ModManager *>((&g_manager->_modManager)))->ModManager::TryRedirectPath(&tmpPath,&tmpName);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 5;
|
|
stagesPath = extraout_EAX_01;
|
|
if (0xf < *GHIDRA_CAST<uint *>((extraout_EAX_01 + 0x14))) {
|
|
stagesPath = *GHIDRA_CAST<byte **>(extraout_EAX_01);
|
|
}
|
|
LoadMinibossesXml(GHIDRA_CAST<Game *>(&pGVar1->_roomConfig),stagesPath);
|
|
local_14 = (void *)CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),4);
|
|
if (0xf < tmpPath._capacity) {
|
|
uVar4 = tmpPath._capacity + 1;
|
|
pvVar3 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)tmpPath._buf)) + 0x0)));
|
|
if (0xfff < uVar4) {
|
|
pvVar3 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpPath._buf)) + 0x0))) + -4);
|
|
uVar4 = tmpPath._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar3))))) goto LAB_006f4a84;
|
|
}
|
|
operator_delete(pvVar3,uVar4);
|
|
}
|
|
local_14 = (void *)0xffffffff;
|
|
tmpPath._size = 0;
|
|
tmpPath._capacity = 0xf;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpPath._buf)) + 0x0))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpPath._buf)) + 0x0))) & 0xffffff00;
|
|
if (0xf < tmpName._capacity) {
|
|
uVar4 = tmpName._capacity + 1;
|
|
pvVar3 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)tmpName._buf)) + 0x0)));
|
|
if (0xfff < uVar4) {
|
|
pvVar3 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpName._buf)) + 0x0))) + -4);
|
|
uVar4 = tmpName._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpName._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar3))))) {
|
|
LAB_006f4a84:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar3,uVar4);
|
|
}
|
|
builtin_strncpy(tmpName._buf,"giantbook.xml",0xe);
|
|
tmpName._capacity = 0xf;
|
|
tmpName._size = 0xd;
|
|
local_14 = (void *)0x6;
|
|
(GHIDRA_CAST<ModManager *>((&g_manager->_modManager)))->ModManager::TryRedirectPath(GHIDRA_CAST<std_string *>(local_6c),&tmpName);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 7;
|
|
stagesPath = extraout_EAX_02;
|
|
if (0xf < *GHIDRA_CAST<uint *>((extraout_EAX_02 + 0x14))) {
|
|
stagesPath = *GHIDRA_CAST<byte **>(extraout_EAX_02);
|
|
}
|
|
load_giantbook_xml(&pGVar1->_itemOverlay,stagesPath);
|
|
local_14 = (void *)CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),6);
|
|
if (0xf < local_58) {
|
|
uVar4 = local_58 + 1;
|
|
pvVar3 = local_6c[0];
|
|
if (0xfff < uVar4) {
|
|
pvVar3 = *(void **)(GHIDRA_INT(local_6c[0]) + -4);
|
|
uVar4 = local_58 + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(local_6c[0]) + (-4 - GHIDRA_INT(pvVar3))))) goto LAB_006f4b6e;
|
|
}
|
|
operator_delete(pvVar3,uVar4);
|
|
}
|
|
local_14 = (void *)0xffffffff;
|
|
local_5c = 0;
|
|
local_58 = 0xf;
|
|
local_6c[0] = (void *)(GHIDRA_UINT(local_6c[0]) & 0xffffff00);
|
|
if (0xf < tmpName._capacity) {
|
|
uVar4 = tmpName._capacity + 1;
|
|
pvVar3 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)tmpName._buf)) + 0x0)));
|
|
if (0xfff < uVar4) {
|
|
pvVar3 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpName._buf)) + 0x0))) + -4);
|
|
uVar4 = tmpName._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpName._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar3))))) {
|
|
LAB_006f4b6e:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar3,uVar4);
|
|
}
|
|
manager = g_manager;
|
|
longNameBuf = std::_Allocate(0x20);
|
|
tmpName._size = 0x10;
|
|
tmpName._capacity = 0x1f;
|
|
builtin_strncpy(longNameBuf,"bossoverlays.xml",0x11);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpName._buf)) + 0x0))) = longNameBuf;
|
|
local_14 = (void *)0x8;
|
|
(GHIDRA_CAST<ModManager *>((&manager->_modManager)))->ModManager::TryRedirectPath(&tmpPath,&tmpName);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 9;
|
|
puVar2 = extraout_EAX_03;
|
|
if (0xf < GHIDRA_UINT(extraout_EAX_03[5])) {
|
|
puVar2 = GHIDRA_CAST<undefined4 *>(*extraout_EAX_03);
|
|
}
|
|
load_bossoverlays_xml(puVar2);
|
|
local_14 = (void *)CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),8);
|
|
if (0xf < tmpPath._capacity) {
|
|
uVar4 = tmpPath._capacity + 1;
|
|
pvVar3 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)tmpPath._buf)) + 0x0)));
|
|
if (0xfff < uVar4) {
|
|
pvVar3 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpPath._buf)) + 0x0))) + -4);
|
|
uVar4 = tmpPath._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar3))))) goto LAB_006f4c52;
|
|
}
|
|
operator_delete(pvVar3,uVar4);
|
|
}
|
|
local_14 = (void *)0xffffffff;
|
|
tmpPath._size = 0;
|
|
tmpPath._capacity = 0xf;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpPath._buf)) + 0x0))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpPath._buf)) + 0x0))) & 0xffffff00;
|
|
if (0xf < tmpName._capacity) {
|
|
uVar4 = tmpName._capacity + 1;
|
|
pvVar3 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)tmpName._buf)) + 0x0)));
|
|
if (0xfff < uVar4) {
|
|
pvVar3 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpName._buf)) + 0x0))) + -4);
|
|
uVar4 = tmpName._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpName._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar3))))) {
|
|
LAB_006f4c52:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar3,uVar4);
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>(&pGVar1->_gameOver) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((pGVar1->_gameOver))) + 0x4)))) = 0;
|
|
(pGVar1->_gameOver)._isStopSoundsPending = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pGVar1)) + 0x1d64c)))) = 0;
|
|
(GHIDRA_CAST<ScoreSheet *>((GHIDRA_CAST<ScoreSheet *>(&pGVar1->_leaderboard))))->ScoreSheet::LoadAnm2();
|
|
(GHIDRA_CAST<OnlineEmotes *>((&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pGVar1)) + 0x25108))))))->OnlineEmotes::init();
|
|
(GHIDRA_CAST<CompletionWidget *>((GHIDRA_CAST<CompletionWidget *>(&pGVar1->_onlineStatsScreen))))->CompletionWidget::Load();
|
|
FUN_009a1970();
|
|
(GHIDRA_CAST<PauseScreen *>((&pGVar1->_pauseScreen)))->PauseScreen::Init();
|
|
(GHIDRA_CAST<RevivePlayerMenu *>((&pGVar1->_revivePlayerMenu)))->RevivePlayerMenu::Init();
|
|
(GHIDRA_CAST<Minimap *>((&pGVar1->_minimap)))->Minimap::Init();
|
|
tmpName._capacity = 0xf;
|
|
tmpName._size = 10;
|
|
builtin_strncpy(tmpName._buf,"ambush.x",8);
|
|
tmpName._buf[8] = 'm';
|
|
tmpName._buf[9] = 'l';
|
|
tmpName._buf[10] = '\0';
|
|
local_14 = (void *)0xa;
|
|
(GHIDRA_CAST<ModManager *>((&g_manager->_modManager)))->ModManager::TryRedirectPath(&tmpPath,&tmpName);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xb;
|
|
puVar2 = extraout_EAX_04;
|
|
if (0xf < GHIDRA_UINT(extraout_EAX_04[5])) {
|
|
puVar2 = GHIDRA_CAST<undefined4 *>(*extraout_EAX_04);
|
|
}
|
|
LoadBossRushXml(puVar2);
|
|
local_14 = (void *)CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),10);
|
|
if (0xf < tmpPath._capacity) {
|
|
uVar4 = tmpPath._capacity + 1;
|
|
pvVar3 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)tmpPath._buf)) + 0x0)));
|
|
if (0xfff < uVar4) {
|
|
pvVar3 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpPath._buf)) + 0x0))) + -4);
|
|
uVar4 = tmpPath._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar3))))) goto LAB_006f4da8;
|
|
}
|
|
operator_delete(pvVar3,uVar4);
|
|
}
|
|
local_14 = (void *)0xffffffff;
|
|
tmpPath._size = 0;
|
|
tmpPath._capacity = 0xf;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpPath._buf)) + 0x0))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpPath._buf)) + 0x0))) & 0xffffff00;
|
|
if (0xf < tmpName._capacity) {
|
|
uVar4 = tmpName._capacity + 1;
|
|
pvVar3 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)tmpName._buf)) + 0x0)));
|
|
if (0xfff < uVar4) {
|
|
pvVar3 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpName._buf)) + 0x0))) + -4);
|
|
uVar4 = tmpName._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpName._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar3))))) {
|
|
LAB_006f4da8:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar3,uVar4);
|
|
}
|
|
tmpName._capacity = 0xf;
|
|
tmpName._size = 0xb;
|
|
builtin_strncpy(tmpName._buf,"preload.xml",0xc);
|
|
local_14 = (void *)0xc;
|
|
(GHIDRA_CAST<ModManager *>((&g_manager->_modManager)))->ModManager::TryRedirectPath(GHIDRA_CAST<std_string *>(local_6c),&tmpName);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xd;
|
|
stagesPath = extraout_EAX_05;
|
|
if (0xf < *GHIDRA_CAST<uint *>((extraout_EAX_05 + 0x14))) {
|
|
stagesPath = *GHIDRA_CAST<byte **>(extraout_EAX_05);
|
|
}
|
|
load_preloads_xml(&pGVar1->_preloadManager,stagesPath);
|
|
local_14 = (void *)CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),0xc);
|
|
if (0xf < local_58) {
|
|
uVar4 = local_58 + 1;
|
|
pvVar3 = local_6c[0];
|
|
if (0xfff < uVar4) {
|
|
pvVar3 = *(void **)(GHIDRA_INT(local_6c[0]) + -4);
|
|
uVar4 = local_58 + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(local_6c[0]) + (-4 - GHIDRA_INT(pvVar3))))) goto LAB_006f4e94;
|
|
}
|
|
operator_delete(pvVar3,uVar4);
|
|
}
|
|
local_14 = (void *)0xffffffff;
|
|
local_5c = 0;
|
|
local_58 = 0xf;
|
|
local_6c[0] = (void *)(GHIDRA_UINT(local_6c[0]) & 0xffffff00);
|
|
if (0xf < tmpName._capacity) {
|
|
uVar4 = tmpName._capacity + 1;
|
|
pvVar3 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)tmpName._buf)) + 0x0)));
|
|
if (0xfff < uVar4) {
|
|
pvVar3 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpName._buf)) + 0x0))) + -4);
|
|
uVar4 = tmpName._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpName._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar3))))) {
|
|
LAB_006f4e94:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar3,uVar4);
|
|
}
|
|
tmpPath._capacity = 0xf;
|
|
tmpPath._size = 6;
|
|
builtin_strncpy(tmpPath._buf,"common",7);
|
|
local_14 = (void *)0xe;
|
|
(GHIDRA_CAST<PreloadManager *>((&pGVar1->_preloadManager)))->PreloadManager::load_group(&tmpPath);
|
|
local_14 = (void *)0xffffffff;
|
|
tmpName._capacity = 0xf;
|
|
tmpName._size = 0;
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(tmpName._buf)) + 0x0))) = (*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(tmpName._buf)) + 0x0))) & 0xffffffff00000000;
|
|
(GHIDRA_CAST<std::string *>((tmpName._buf)))->std::string::assign(&DAT_00b68200,5);
|
|
local_14 = (void *)0xf;
|
|
(GHIDRA_CAST<PreloadManager *>((&pGVar1->_preloadManager)))->PreloadManager::load_group(&tmpName);
|
|
local_14 = (void *)0xffffffff;
|
|
if (0xf < tmpName._capacity) {
|
|
uVar4 = tmpName._capacity + 1;
|
|
pvVar3 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)tmpName._buf)) + 0x0)));
|
|
if (0xfff < uVar4) {
|
|
pvVar3 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpName._buf)) + 0x0))) + -4);
|
|
uVar4 = tmpName._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpName._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar3))))) goto LAB_006f5040;
|
|
}
|
|
operator_delete(pvVar3,uVar4);
|
|
}
|
|
tmpName._size = 0;
|
|
tmpName._capacity = 0xf;
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(tmpName._buf)) + 0x0))) = (*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(tmpName._buf)) + 0x0))) & 0xffffffff00000000;
|
|
(GHIDRA_CAST<std::string *>((tmpName._buf)))->std::string::assign(GHIDRA_CAST<byte *>("pickups"),7);
|
|
local_14 = (void *)0x10;
|
|
(GHIDRA_CAST<PreloadManager *>((&pGVar1->_preloadManager)))->PreloadManager::load_group(&tmpName);
|
|
local_14 = (void *)0xffffffff;
|
|
if (0xf < tmpName._capacity) {
|
|
uVar4 = tmpName._capacity + 1;
|
|
pvVar3 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)tmpName._buf)) + 0x0)));
|
|
if (0xfff < uVar4) {
|
|
pvVar3 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpName._buf)) + 0x0))) + -4);
|
|
uVar4 = tmpName._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpName._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar3))))) goto LAB_006f5040;
|
|
}
|
|
operator_delete(pvVar3,uVar4);
|
|
}
|
|
tmpName._size = 0;
|
|
tmpName._capacity = 0xf;
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(tmpName._buf)) + 0x0))) = (*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(tmpName._buf)) + 0x0))) & 0xffffffff00000000;
|
|
(GHIDRA_CAST<std::string *>((tmpName._buf)))->std::string::assign(GHIDRA_CAST<byte *>("icons"),5);
|
|
local_14 = (void *)0x11;
|
|
(GHIDRA_CAST<PreloadManager *>((&pGVar1->_preloadManager)))->PreloadManager::load_group(&tmpName);
|
|
local_14 = (void *)0xffffffff;
|
|
if (0xf < tmpName._capacity) {
|
|
uVar4 = tmpName._capacity + 1;
|
|
pvVar3 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)tmpName._buf)) + 0x0)));
|
|
if (0xfff < uVar4) {
|
|
pvVar3 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpName._buf)) + 0x0))) + -4);
|
|
uVar4 = tmpName._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpName._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar3))))) {
|
|
LAB_006f5040:
|
|
local_14 = (void *)0xffffffff;
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar3,uVar4);
|
|
}
|
|
init_procedural_item_surfaces(&pGVar1->_proceduralItemManager);
|
|
pGVar1->_bossRushParTime = 36000;
|
|
pGVar1->_blueWombParTime = 54000;
|
|
(GHIDRA_CAST<GenericPrompt *>((&pGVar1->_genericPrompt)))->GenericPrompt::Initialize(0);
|
|
VictoryRunPrompt::Load(extraout_ECX);
|
|
tmpName._size = 0;
|
|
tmpName._capacity = 0xf;
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(tmpName._buf)) + 0x0))) = (*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(tmpName._buf)) + 0x0))) & 0xffffffff00000000;
|
|
(GHIDRA_CAST<std::string *>((tmpName._buf)))->std::string::assign(GHIDRA_CAST<byte *>("gfx/ui/completion_widget.anm2"),0x1d);
|
|
local_14 = (void *)0x12;
|
|
(GHIDRA_CAST<ANM2 *>((&pGVar1->_completionWidgetSprite)))->ANM2::Load(&tmpName,1);
|
|
local_14 = (void *)0xffffffff;
|
|
if (0xf < tmpName._capacity) {
|
|
uVar4 = tmpName._capacity + 1;
|
|
pvVar3 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)tmpName._buf)) + 0x0)));
|
|
if (0xfff < uVar4) {
|
|
pvVar3 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpName._buf)) + 0x0))) + -4);
|
|
uVar4 = tmpName._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpName._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar3))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar3,uVar4);
|
|
}
|
|
isIdleSet = (GHIDRA_CAST<ANM2 *>((&pGVar1->_completionWidgetSprite)))->ANM2::SetAnimation(s_Idle,1);
|
|
if ((isIdleSet != 0) && ((pGVar1->_completionWidgetSprite)._animState._animData != (void *)0x0)) {
|
|
(GHIDRA_CAST<AnimationState *>((&(pGVar1->_completionWidgetSprite)._animState)))->AnimationState::SetFrameFloat(0.0);
|
|
if ((pGVar1->_completionWidgetSprite)._animState._animData != (void *)0x0) {
|
|
(pGVar1->_completionWidgetSprite)._animState._isPlaying = 0;
|
|
}
|
|
}
|
|
if (*GHIDRA_CAST<int *>(pGVar1->_giantBookClickerImage) == 0) {
|
|
pvVar3 = Manager::LoadImage(loadedImage,GHIDRA_CAST<byte *>("gfx/ui/giantbook/GiantBook_Clicker.png"));
|
|
local_14 = (void *)0x13;
|
|
(GHIDRA_CAST<KAGE::SmartPointer *>((pGVar1->_giantBookClickerImage)))->KAGE::SmartPointer::operator_assign(pvVar3);
|
|
local_14 = (void *)0x14;
|
|
if (loadedImageRefCount != GHIDRA_CAST<int *>(0x0)) {
|
|
isReleased = (**(code **)(*loadedImageRefCount + 0xc))();
|
|
if ((isReleased != '\0') && (g_imageReleaseFn != (void *)0x0)) {
|
|
(*g_imageReleaseFn)(loadedImage);
|
|
}
|
|
}
|
|
local_14 = (void *)0xffffffff;
|
|
clickerImage = *GHIDRA_CAST<int **>(pGVar1->_giantBookClickerImage);
|
|
if ((clickerImage[0xe] != 0) || (clickerImage[0xf] != 0)) {
|
|
(**(code **)(*clickerImage + 0x48))(0,0);
|
|
clickerImage[0xe] = 0;
|
|
clickerImage[0xf] = 0;
|
|
}
|
|
}
|
|
(pGVar1->_onlinePlayerStats)._end = (pGVar1->_onlinePlayerStats)._begin;
|
|
entriesLeft = 0x15;
|
|
puVar2 = GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pGVar1)) + 0x1bc14))));
|
|
do {
|
|
puVar2[1] = *puVar2;
|
|
entriesLeft = entriesLeft + -1;
|
|
puVar2 = puVar2 + 0xd;
|
|
} while (entriesLeft != 0);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((pGVar1)) + 0x1c030))) = 0;
|
|
FUN_00686060();
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 006f5210
|
|
void Game::Fadein(float speed, byte isShowIcon, KColor *color)
|
|
{
|
|
float fVar1;
|
|
float fVar2;
|
|
undefined4 *playerIt;
|
|
float local_XMM0_Da_36;
|
|
Entity_Player *player;
|
|
byte isInstantFadeIn;
|
|
|
|
isInstantFadeIn = this->_isInstantFadeIn;
|
|
local_XMM0_Da_36 = color->_green;
|
|
fVar1 = color->_blue;
|
|
fVar2 = color->_alpha;
|
|
(this->_fadeInColor)._red = color->_red;
|
|
(this->_fadeInColor)._green = local_XMM0_Da_36;
|
|
(this->_fadeInColor)._blue = fVar1;
|
|
(this->_fadeInColor)._alpha = fVar2;
|
|
(this->_fadeInColor)._unk = color->_unk;
|
|
if (isInstantFadeIn == 0) {
|
|
local_XMM0_Da_36 = 1.0;
|
|
}
|
|
else {
|
|
local_XMM0_Da_36 = 1e-05;
|
|
}
|
|
(this->_fadeInColor)._alpha = local_XMM0_Da_36;
|
|
this->_fadeSpeed = speed;
|
|
this->_isFadeInIconShown = isShowIcon;
|
|
playerIt = (this->_playerManager)._playerList._begin;
|
|
if (playerIt != (this->_playerManager)._playerList._end) {
|
|
do {
|
|
player = GHIDRA_CAST<Entity_Player *>(*playerIt);
|
|
playerIt = playerIt + 1;
|
|
player->_isControlsEnabled = 0;
|
|
} while (playerIt != (this->_playerManager)._playerList._end);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 006f5290
|
|
void Game::Fadeout(float speed, int target, KColor *color)
|
|
{
|
|
float alpha;
|
|
float blue;
|
|
float green;
|
|
float red;
|
|
|
|
if (GHIDRA_UINT(target) < 0xc) {
|
|
this->_fadeSpeed = speed;
|
|
red = color->_red;
|
|
green = color->_green;
|
|
blue = color->_blue;
|
|
alpha = (this->_fadeOutColor)._alpha;
|
|
this->_fadeOutTarget = target;
|
|
(this->_fadeOutColor)._red = red;
|
|
(this->_fadeOutColor)._green = green;
|
|
(this->_fadeOutColor)._blue = blue;
|
|
(this->_fadeOutColor)._alpha = alpha;
|
|
(this->_fadeOutColor)._unk = 0;
|
|
(this->_fadeOutColor)._alpha = speed + (this->_fadeOutColor)._alpha;
|
|
return;
|
|
}
|
|
KAGE_LogMessage(8,GHIDRA_CAST<byte *>("Invalid target specified to (GHIDRA_CAST<Game *>(()))->Game::Fadeout()\n"));
|
|
return;
|
|
}
|
|
|
|
// 006f5320
|
|
void Game::Start(int playertype, int challenge, Seeds seeds, uint difficulty)
|
|
{
|
|
Game *seedEffectSet = this;
|
|
void **game;
|
|
Room *this_01;
|
|
Game *this_02;
|
|
byte bVar1;
|
|
Seeds *other;
|
|
ChallengeParam *challengeParams;
|
|
byte *extraout_EAX;
|
|
undefined4 *onlineStatEntry;
|
|
int unusedArg;
|
|
void *pvVar2;
|
|
int iVar3;
|
|
uint uVar4;
|
|
Seeds *local_ESI_410;
|
|
byte *filename;
|
|
Seeds seedsCopy;
|
|
void *itemPoolPath [4];
|
|
uint itemPoolPathSize;
|
|
uint itemPoolPathCapacity;
|
|
undefined1 tmpString [8];
|
|
char acStack_24 [4];
|
|
undefined4 *puStack_20;
|
|
undefined4 *puStack_1c;
|
|
uint tmpStringCapacity;
|
|
uint local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
Manager *manager;
|
|
undefined4 *playersEnd;
|
|
|
|
this_02 = g_game;
|
|
puStack_c = &LAB_00afbdc8;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_UINT((tmpString + 0x28));
|
|
ExceptionList = &local_10;
|
|
local_8 = 0;
|
|
iVar3 = 0x15;
|
|
pvVar2 = (g_game->_onlinePlayerStats)._begin;
|
|
onlineStatEntry = GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((g_game)) + 0x1bc14))));
|
|
g_game->_isStarted = 1;
|
|
(this_02->_onlinePlayerStats)._end = pvVar2;
|
|
do {
|
|
onlineStatEntry[1] = *onlineStatEntry;
|
|
iVar3 = iVar3 + -1;
|
|
onlineStatEntry = onlineStatEntry + 0xd;
|
|
} while (iVar3 != 0);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this_02)) + 0x1c030))) = 0;
|
|
this_02->_difficulty = difficulty;
|
|
this_02->_challenge = challenge;
|
|
manager = g_manager;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this_02)) + 0x68d74)))) = 0;
|
|
this_02->_victoryLap = 0;
|
|
this_02->_isConsoleUsedThisRun = manager->_isConsoleEnabled;
|
|
(GHIDRA_CAST<HUD *>((&this_02->_hud)))->HUD::LoadGraphics();
|
|
if (seeds._gameStartSeed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Start seed is not initialized"));
|
|
}
|
|
(GHIDRA_CAST<Seeds *>((&seedsCopy)))->Seeds::construct_from_copy(&seeds);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
|
|
(GHIDRA_CAST<Seeds *>((&this_02->_seedEffects)))->Seeds::operator_assign(other);
|
|
local_8 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_8))) + 0x1))) << 8;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<std::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(&seedsCopy._seedEffects,
|
|
(fuzzer_allocator<std::_Tree_node<unsigned_int,void*>_> *)&seedsCopy._seedEffects,
|
|
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(seedsCopy._seedEffects) + 4));
|
|
operator_delete(seedsCopy._seedEffects,0x14);
|
|
if (this_02->_challenge != 0) {
|
|
pvVar2 = (this_02->_seedEffects)._seedEffects;
|
|
game = &(this_02->_seedEffects)._seedEffects;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<std::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(game,(fuzzer_allocator<std::_Tree_node<unsigned_int,void*>_> *)game,
|
|
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(pvVar2) + 4));
|
|
*(void **)(GHIDRA_CAST<char *>(pvVar2) + 4) = pvVar2;
|
|
*(void **)pvVar2 = pvVar2;
|
|
*(void **)(GHIDRA_CAST<char *>(pvVar2) + 8) = pvVar2;
|
|
(this_02->_seedEffects)._seedEffectsCount = 0;
|
|
challengeParams = GetChallengeParams(this_02);
|
|
uVar4 = 0;
|
|
if (GHIDRA_INT((challengeParams->_seedEffects)._end) - GHIDRA_INT((challengeParams->_seedEffects)._begin) >> 2
|
|
!= 0) {
|
|
do {
|
|
Seeds::AddSeedEffect
|
|
(&this_02->_seedEffects,
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT((challengeParams->_seedEffects)._begin) + uVar4 * 4)));
|
|
uVar4 = uVar4 + 1;
|
|
} while (uVar4 < GHIDRA_UINT((GHIDRA_INT((challengeParams->_seedEffects)._end) -
|
|
GHIDRA_INT((challengeParams->_seedEffects)._begin) >> 2)));
|
|
}
|
|
}
|
|
local_ESI_410 = &this_02->_seedEffects;
|
|
uVar4 = (GHIDRA_CAST<Seeds *>((local_ESI_410)))->Seeds::GetNextSeed();
|
|
manager = g_manager;
|
|
(this_02->_fortuneRNG)._seed = uVar4;
|
|
(this_02->_fortuneRNG)._shift1 = 5;
|
|
(this_02->_fortuneRNG)._shift2 = 9;
|
|
(this_02->_fortuneRNG)._shift3 = 7;
|
|
if ((((local_ESI_410->_isCustomRun == 0) &&
|
|
(bVar1 = (GHIDRA_CAST<Seeds *>((local_ESI_410)))->Seeds::AchievementUnlocksDisallowed(), bVar1 == 0)) &&
|
|
(bVar1 = Manager::IsGameplayInputActive(unusedArg), bVar1 == 0)) &&
|
|
((this_02->_isRerun == 0 && (this_02->_challenge == 0)))) {
|
|
bVar1 = 0;
|
|
}
|
|
else {
|
|
bVar1 = 1;
|
|
}
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("Setting PersistentGameData ReadOnly to %s\n"));
|
|
(manager->_persistentGameData)._isReadOnly = bVar1;
|
|
uVar4 = (this_02->_seedEffects)._gameStartSeed;
|
|
if (uVar4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Error: Game Start Seed was not set.\n"));
|
|
uVar4 = (this_02->_seedEffects)._gameStartSeed;
|
|
}
|
|
if (uVar4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Error: Game Start Seed was not set.\n"));
|
|
uVar4 = (this_02->_seedEffects)._gameStartSeed;
|
|
}
|
|
Seeds::Seed2String(GHIDRA_CAST<std_string *>(tmpString),uVar4);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 2;
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("RNG Start Seed: %s (%u) [New, %d]\n"));
|
|
local_8 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_8))) + 0x1))) << 8;
|
|
if (0xf < tmpStringCapacity) {
|
|
uVar4 = tmpStringCapacity + 1;
|
|
pvVar2 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)tmpString)) + 0x0)));
|
|
if (0xfff < uVar4) {
|
|
pvVar2 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString)) + 0x0))) + -4);
|
|
uVar4 = tmpStringCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString)) + 0x0))) + (-4 - GHIDRA_INT(pvVar2))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar2,uVar4);
|
|
}
|
|
init_procedural_item_surfaces(&this_02->_proceduralItemManager);
|
|
builtin_strncpy(acStack_24,"s.xm",4);
|
|
tmpStringCapacity = 0xf;
|
|
puStack_1c = GHIDRA_CAST<undefined4 *>(&DAT_0000000d);
|
|
tmpString = (undefined1 [8])0x6c6f6f706d657469;
|
|
puStack_20 = GHIDRA_CAST<undefined4 *>(CONCAT22((*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(&(puStack_20)) + 0x2))),0x6c));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 3;
|
|
ModManager::TryRedirectPath
|
|
(&g_manager->_modManager,GHIDRA_CAST<std_string *>(itemPoolPath),GHIDRA_CAST<std_string *>(tmpString));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 4;
|
|
filename = extraout_EAX;
|
|
if (0xf < *GHIDRA_CAST<uint *>((extraout_EAX + 0x14))) {
|
|
filename = *GHIDRA_CAST<byte **>(extraout_EAX);
|
|
}
|
|
uVar4 = (GHIDRA_CAST<Seeds *>((local_ESI_410)))->Seeds::GetNextSeed();
|
|
(GHIDRA_CAST<ItemPool *>((&this_02->_itemPool)))->ItemPool::Init(uVar4,filename);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 3;
|
|
if (0xf < itemPoolPathCapacity) {
|
|
uVar4 = itemPoolPathCapacity + 1;
|
|
pvVar2 = itemPoolPath[0];
|
|
if (0xfff < uVar4) {
|
|
pvVar2 = *(void **)(GHIDRA_INT(itemPoolPath[0]) + -4);
|
|
uVar4 = itemPoolPathCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(itemPoolPath[0]) + (-4 - GHIDRA_INT(pvVar2))))) goto LAB_006f56df;
|
|
}
|
|
operator_delete(pvVar2,uVar4);
|
|
}
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0;
|
|
itemPoolPathSize = 0;
|
|
itemPoolPathCapacity = 0xf;
|
|
itemPoolPath[0] = (void *)(GHIDRA_UINT(itemPoolPath[0]) & 0xffffff00);
|
|
if (0xf < tmpStringCapacity) {
|
|
uVar4 = tmpStringCapacity + 1;
|
|
pvVar2 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)tmpString)) + 0x0)));
|
|
if (0xfff < uVar4) {
|
|
pvVar2 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString)) + 0x0))) + -4);
|
|
uVar4 = tmpStringCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString)) + 0x0))) + (-4 - GHIDRA_INT(pvVar2))))) {
|
|
LAB_006f56df:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar2,uVar4);
|
|
}
|
|
uVar4 = (this_02->_seedEffects)._gameStartSeed;
|
|
if (uVar4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Error: Game Start Seed was not set.\n"));
|
|
uVar4 = (this_02->_seedEffects)._gameStartSeed;
|
|
}
|
|
(GHIDRA_CAST<BossPool *>((&this_02->_bossPool)))->BossPool::init(uVar4);
|
|
if ((this_02->_seedEffects)._gameStartSeed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Error: Game Start Seed was not set.\n"));
|
|
}
|
|
PlayerManager::init_main_player
|
|
(&this_02->_playerManager,playertype,(this_02->_seedEffects)._playerInitSeed);
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(this_02))))->Level::SetNextStage();
|
|
if (challenge == 0x1f) {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(this_02))))->Level::SetStage(0xb,0);
|
|
}
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(this_02))))->Level::Init(1);
|
|
std::vector<int>::copy_constructor(&this_02->_playerManager);
|
|
playersEnd = puStack_1c;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 5;
|
|
for (onlineStatEntry = puStack_20; onlineStatEntry != playersEnd;
|
|
onlineStatEntry = onlineStatEntry + 1) {
|
|
if ((GHIDRA_CAST<Entity_Player *>(*onlineStatEntry))->_variant == 0) {
|
|
(GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(*onlineStatEntry))))->Entity_Player::InitPostLevelInitStats();
|
|
}
|
|
}
|
|
local_8 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_8))) + 0x1))) << 8;
|
|
FID_conflict__Tidy(&puStack_20);
|
|
Manager::save_game_state();
|
|
(GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::trigger_new_room_effects();
|
|
tmpStringCapacity = 0;
|
|
tmpString = (undefined1 [8])((ulonglong)tmpString & 0xffffffff);
|
|
acStack_24[0] = '\0';
|
|
acStack_24[1] = '\0';
|
|
acStack_24[2] = '\0';
|
|
acStack_24[3] = '\0';
|
|
puStack_20 = GHIDRA_CAST<undefined4 *>(0x0);
|
|
puStack_1c = GHIDRA_CAST<undefined4 *>(0x3f800000);
|
|
Fadein(this_02,0.04,1,GHIDRA_CAST<KColor *>((tmpString + 4)));
|
|
FUN_009b5cb0();
|
|
this_01 = this_02->_room;
|
|
*GHIDRA_CAST<undefined4 *>((this_02->_encounteredBosses + 4)) = *GHIDRA_CAST<undefined4 *>(this_02->_encounteredBosses);
|
|
(GHIDRA_CAST<Room *>((this_01)))->Room::Update();
|
|
this_02->_framesSinceRoomTransition = 0;
|
|
LuaEngine::PostGameStart(0);
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<std::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(&seeds._seedEffects,
|
|
(fuzzer_allocator<std::_Tree_node<unsigned_int,void*>_> *)&seeds._seedEffects,
|
|
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(seeds._seedEffects) + 4));
|
|
operator_delete(seeds._seedEffects,0x14);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 006f6500
|
|
void Game::add_players(int *users, uint flags)
|
|
{
|
|
code *pcVar1;
|
|
bool bVar2;
|
|
byte bVar3;
|
|
char cVar4;
|
|
uint uVar5;
|
|
Entity_Player *pEVar6;
|
|
Entity_Player *extraout_EAX;
|
|
undefined4 userIdLo;
|
|
Entity_Player *extraout_EAX_00;
|
|
int iVar7;
|
|
int *piVar8;
|
|
undefined4 userIdHi;
|
|
undefined4 *puVar9;
|
|
uint uVar10;
|
|
int iVar11;
|
|
Game *game;
|
|
void *pvVar12;
|
|
int *newPlayerIt;
|
|
int *newPlayersEnd;
|
|
undefined8 local_7c;
|
|
undefined **local_74;
|
|
int *local_70;
|
|
int *lobbyRefCount;
|
|
undefined **local_60;
|
|
int *local_5c;
|
|
void *deviceAlloc;
|
|
ItemPool *local_54;
|
|
uint local_50;
|
|
undefined4 rngShift1;
|
|
undefined4 local_44;
|
|
int iStack_40;
|
|
undefined8 local_3c;
|
|
uint local_34;
|
|
undefined4 local_30;
|
|
Entity_Player *local_2c;
|
|
Game *local_28;
|
|
undefined8 local_24;
|
|
int *newPlayersCapacity;
|
|
uint userIdx;
|
|
Entity_Player *local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
Manager *manager;
|
|
void *proceduralItems;
|
|
|
|
puStack_c = &LAB_00afbee6;
|
|
local_10 = ExceptionList;
|
|
uVar5 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
ExceptionList = &local_10;
|
|
local_30 = 0;
|
|
local_34 = 0;
|
|
local_2c = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
newPlayersEnd = GHIDRA_CAST<int *>(0x0);
|
|
newPlayersCapacity = GHIDRA_CAST<int *>(0x0);
|
|
local_8 = 0;
|
|
userIdx = 0;
|
|
iVar7 = *users;
|
|
iVar11 = users[1] - iVar7 >> 0x1f;
|
|
local_28 = this;
|
|
if ((users[1] - iVar7) / 0x14 + iVar11 != iVar11) {
|
|
local_54 = GHIDRA_CAST<ItemPool *>((flags & 1));
|
|
local_50 = flags & 2;
|
|
do {
|
|
iVar11 = userIdx * 0x14;
|
|
iStack_40 = iVar11;
|
|
if (local_54 == GHIDRA_CAST<ItemPool *>(0x0)) {
|
|
cVar4 = (**(code **)(*GHIDRA_CAST<int *>((iVar11 + iVar7)) + 0x14))(uVar5);
|
|
manager = g_manager;
|
|
if (cVar4 == '\0') {
|
|
local_3c = CONCAT44(*users + iVar11,(undefined4)local_3c);
|
|
iVar7 = *GHIDRA_CAST<int *>((*users + iVar11 + 4));
|
|
if (iVar7 == 0) {
|
|
local_24 = 0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_24)) + 0x4))) = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_24)) + 0x0))) = 0;
|
|
userIdLo = (undefined4)local_24;
|
|
userIdHi = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_24)) + 0x4)));
|
|
}
|
|
else {
|
|
userIdLo = *GHIDRA_CAST<undefined4 *>((iVar7 + 8));
|
|
userIdHi = *GHIDRA_CAST<undefined4 *>((iVar7 + 0xc));
|
|
}
|
|
local_7c = CONCAT44(userIdHi,userIdLo);
|
|
pEVar6 = PlayerManager::get_player_by_user_id
|
|
(GHIDRA_CAST<PlayerManager *>(&g_manager->_netplayManager),&local_7c);
|
|
local_24 = CONCAT44(pEVar6,(undefined4)local_24);
|
|
if (pEVar6 == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
local_5c = operator_new(0x3f8);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 2;
|
|
if (local_5c == GHIDRA_CAST<int *>(0x0)) {
|
|
pEVar6 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<NetInputDevice *>((local_5c)))->NetInputDevice::NetInputDevice((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_3c)) + 0x4))));
|
|
pEVar6 = extraout_EAX_00;
|
|
}
|
|
local_8 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_8))) + 0x1))) << 8;
|
|
local_24 = CONCAT44(pEVar6,(undefined4)local_24);
|
|
FUN_00905f60(pEVar6);
|
|
puVar9 = *GHIDRA_CAST<undefined4 **>((manager + 1));
|
|
if (puVar9 == *GHIDRA_CAST<undefined4 **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(manager[1])) + 0x4))))) {
|
|
std::vector<4byte>::_Emplace_reallocate(puVar9,GHIDRA_INT(&local_24) + 4);
|
|
pEVar6 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_24)) + 0x4)));
|
|
}
|
|
else {
|
|
*puVar9 = pEVar6;
|
|
*GHIDRA_CAST<int *>((manager + 1)) = *GHIDRA_CAST<int *>((manager + 1)) + 4;
|
|
}
|
|
if ((pEVar6->_sizeMulti).x == 0.0) {
|
|
local_3c = 0;
|
|
}
|
|
KAGE_LogMessage(1,(byte *)
|
|
"[Frame: %d] Adding remote player, UserID = %llu, device ID = %d \n");
|
|
}
|
|
else {
|
|
if (iVar7 == 0) {
|
|
local_3c = 0;
|
|
}
|
|
KAGE_LogMessage(8,(byte *)
|
|
"[Frame %d] Attempted to add remote player (id %llu), but they already exist \n"
|
|
);
|
|
}
|
|
iVar11 = iStack_40;
|
|
}
|
|
else {
|
|
pvVar12 = (void *)g_manager->_activeControllerIndex;
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("[Frame: %d] Adding local player, device ID = %d \n"));
|
|
deviceAlloc = operator_new(0x3f8);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
|
|
if (deviceAlloc == (void *)0x0) {
|
|
pEVar6 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<NetInputDevice *>((deviceAlloc)))->NetInputDevice::NetInputDevice(pvVar12);
|
|
pEVar6 = extraout_EAX;
|
|
}
|
|
local_8 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_8))) + 0x1))) << 8;
|
|
(pEVar6->_sizeMulti).x = (float)g_userProfile;
|
|
local_2c = pEVar6;
|
|
FUN_00905f60(pEVar6);
|
|
puVar9 = *GHIDRA_CAST<undefined4 **>((manager + 1));
|
|
if (puVar9 == *GHIDRA_CAST<undefined4 **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(manager[1])) + 0x4))))) {
|
|
std::vector<4byte>::_Emplace_reallocate(puVar9,&local_2c);
|
|
pEVar6 = local_2c;
|
|
}
|
|
else {
|
|
*puVar9 = pEVar6;
|
|
*GHIDRA_CAST<int *>((manager + 1)) = *GHIDRA_CAST<int *>((manager + 1)) + 4;
|
|
}
|
|
}
|
|
pvVar12 = (pEVar6->_damageEvents)._end;
|
|
}
|
|
else {
|
|
iVar7 = (GHIDRA_CAST<int *>((iVar11 + iVar7)))[1];
|
|
if (iVar7 == 0) {
|
|
local_44 = 0;
|
|
iStack_40 = 0;
|
|
local_70 = GHIDRA_CAST<int *>(0x0);
|
|
local_74 = GHIDRA_CAST<undefined **>(0x0);
|
|
}
|
|
else {
|
|
local_74 = *GHIDRA_CAST<undefined ***>((iVar7 + 8));
|
|
local_70 = *GHIDRA_CAST<int **>((iVar7 + 0xc));
|
|
}
|
|
pEVar6 = PlayerManager::get_player_by_user_id
|
|
(GHIDRA_CAST<PlayerManager *>(&g_manager->_netplayManager),GHIDRA_CAST<ulonglong *>(&local_74));
|
|
if (pEVar6 == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
if (iVar7 == 0) {
|
|
local_44 = 0;
|
|
iStack_40 = 0;
|
|
}
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Failed to find input device for UserId %llu\n"));
|
|
}
|
|
pvVar12 = (pEVar6->_damageEvents)._end;
|
|
}
|
|
uVar10 = userIdx;
|
|
game = local_28;
|
|
if (local_50 == 0) {
|
|
if (((flags & 4) == 0) && (userIdx == 0)) {
|
|
if ((local_28->_seedEffects)._gameStartSeed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Error: Game Start Seed was not set.\n"));
|
|
}
|
|
PlayerManager::init_main_player
|
|
(&game->_playerManager,*GHIDRA_CAST<int *>((*users + 0xc)),
|
|
(game->_seedEffects)._playerInitSeed);
|
|
puVar9 = (game->_playerManager)._playerList._begin;
|
|
if (GHIDRA_INT((game->_playerManager)._playerList._end) - GHIDRA_INT(puVar9) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
puVar9 = (game->_playerManager)._playerList._begin;
|
|
}
|
|
local_14 = GHIDRA_CAST<Entity_Player *>(*puVar9);
|
|
uVar10 = userIdx;
|
|
}
|
|
else {
|
|
local_14 = PlayerManager::SpawnCoPlayer2
|
|
(&local_28->_playerManager,*GHIDRA_CAST<int *>((*users + 0xc + iVar11)));
|
|
if (newPlayersEnd == newPlayersCapacity) {
|
|
std::vector<unsigned_int>::_Emplace_reallocate(newPlayersEnd,&local_14);
|
|
uVar10 = userIdx;
|
|
goto LAB_006f68af;
|
|
}
|
|
*newPlayersEnd = GHIDRA_INT(local_14);
|
|
newPlayersEnd = newPlayersEnd + 1;
|
|
uVar10 = userIdx;
|
|
}
|
|
}
|
|
else {
|
|
local_14 = (GHIDRA_CAST<PlayerManager *>((&local_28->_playerManager)))->PlayerManager::get_main_player(userIdx);
|
|
if (newPlayersEnd == newPlayersCapacity) {
|
|
std::vector<unsigned_int>::_Emplace_reallocate(newPlayersEnd,&local_14);
|
|
LAB_006f68af:
|
|
newPlayersCapacity = GHIDRA_CAST<int *>(0x0);
|
|
}
|
|
else {
|
|
*newPlayersEnd = GHIDRA_INT(local_14);
|
|
newPlayersEnd = newPlayersEnd + 1;
|
|
}
|
|
}
|
|
(GHIDRA_CAST<Entity_Player *>((local_14)))->Entity_Player::SetControllerIndex(GHIDRA_INT(pvVar12),1);
|
|
userIdx = uVar10 + 1;
|
|
iVar7 = *users;
|
|
} while (userIdx < GHIDRA_UINT(((users[1] - iVar7) / 0x14)));
|
|
}
|
|
local_2c = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
newPlayerIt = GHIDRA_CAST<int *>(0x0);
|
|
if ((flags & 2) == 0) {
|
|
FUN_00959500();
|
|
}
|
|
if ((flags & 4) != 0) {
|
|
local_74 = KAGE::Network::Multiplayer::ConstLobby::vftable;
|
|
local_70 = GHIDRA_CAST<int *>(0x0);
|
|
lobbyRefCount = GHIDRA_CAST<int *>(0x0);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 3;
|
|
(GHIDRA_CAST<std::shared_ptr *>((&local_70)))->std::shared_ptr::assign(&g_multiplayerLobbyPtr);
|
|
local_74 = KAGE::Network::Multiplayer::Lobby::vftable;
|
|
local_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),4);
|
|
local_30 = 0xd;
|
|
if (local_70 == GHIDRA_CAST<int *>(0x0)) {
|
|
local_5c = GHIDRA_CAST<int *>(0x0);
|
|
}
|
|
else {
|
|
iVar7 = (**(code **)(*local_70 + 0x20))(&local_7c);
|
|
local_5c = *GHIDRA_CAST<int **>((iVar7 + 4));
|
|
}
|
|
local_7c = CONCAT44((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_7c)) + 0x4))),KAGE::System::UserProfileBase::vftable);
|
|
local_60 = KAGE::System::UserProfile::vftable;
|
|
local_8 = 5;
|
|
local_34 = 0x4f;
|
|
local_30 = 0x4f;
|
|
bVar3 = (GHIDRA_CAST<KAGE::System::UserProfile *>((&local_60)))->KAGE::System::UserProfile::is_local_user();
|
|
if (bVar3 != 0) {
|
|
bVar2 = true;
|
|
goto LAB_006f69a3;
|
|
}
|
|
}
|
|
bVar2 = false;
|
|
LAB_006f69a3:
|
|
uVar5 = local_34;
|
|
if ((local_34 & 2) != 0) {
|
|
uVar5 = local_34 & 0xfffffffd;
|
|
local_60 = KAGE::System::UserProfileBase::vftable;
|
|
}
|
|
local_8 = 0;
|
|
if ((uVar5 & 1) != 0) {
|
|
local_74 = KAGE::Network::Multiplayer::ConstLobby::vftable;
|
|
local_8 = 6;
|
|
if (((lobbyRefCount != GHIDRA_CAST<int *>(0x0)) &&
|
|
(cVar4 = (**(code **)(*lobbyRefCount + 0xc))(), cVar4 != '\0')) &&
|
|
(g_lobbyReleaseFn != (void *)0x0)) {
|
|
(*g_lobbyReleaseFn)(&local_70);
|
|
}
|
|
local_8 = local_8 & 0xffffff00;
|
|
}
|
|
if ((bVar2) && (newPlayersEnd != GHIDRA_CAST<int *>(0x0))) {
|
|
do {
|
|
(GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(*newPlayerIt))))->Entity_Player::InitPostLevelInitStats();
|
|
users = GHIDRA_CAST<int *>(0x1);
|
|
(GHIDRA_CAST<InputManager *>((&PTR_vftable_00c57b18)))->InputManager::get_device(&local_60,*GHIDRA_CAST<int *>((*newPlayerIt + 0x1618)));
|
|
local_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),7);
|
|
if ((local_60 != GHIDRA_CAST<undefined **>(0x0)) &&
|
|
(iVar7 = __RTDynamicCast(local_60,0,&KAGE::Input::InputDeviceBase::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::NetInputDevice::RTTI_Type_Descriptor,0),
|
|
iVar7 != 0)) {
|
|
iVar7 = *GHIDRA_CAST<int *>((iVar7 + 0x374));
|
|
if (iVar7 == 0) {
|
|
local_7c = 0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_7c)) + 0x4))) = GHIDRA_CAST<int *>(0x0);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_7c)) + 0x0))) = GHIDRA_CAST<undefined **>(0x0);
|
|
local_70 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_7c)) + 0x4)));
|
|
local_74 = GHIDRA_CAST<undefined **>(local_7c);
|
|
}
|
|
else {
|
|
local_70 = *GHIDRA_CAST<int **>((iVar7 + 0xc));
|
|
local_74 = *GHIDRA_CAST<undefined ***>((iVar7 + 8));
|
|
}
|
|
users = GHIDRA_CAST<int *>(NetplayManager)::restore_player_state
|
|
(&g_manager->_netplayManager,GHIDRA_CAST<ulonglong *>(&local_74),
|
|
GHIDRA_CAST<Entity_Player *>(*newPlayerIt));
|
|
}
|
|
manager = g_manager;
|
|
if ((g_game->_challenge == 0) && ((g_game->_dailyChallenge)._id == 0)) {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("Setting PersistentGameData ReadOnly to %s\n"));
|
|
game = g_game;
|
|
(manager->_persistentGameData)._isReadOnly = 1;
|
|
local_28 = GHIDRA_CAST<Game *>(((game->_stage - GHIDRA_INT(users)) + -1));
|
|
if (0 < GHIDRA_INT(local_28)) {
|
|
local_34 = 0x13;
|
|
uVar10 = 0;
|
|
uVar5 = *GHIDRA_CAST<uint *>((*newPlayerIt + 0x3ec));
|
|
piVar8 = GHIDRA_CAST<int *>((*newPlayerIt + 0x1580));
|
|
rngShift1 = 1;
|
|
local_44 = 5;
|
|
bVar2 = false;
|
|
do {
|
|
if (*piVar8 != 0) {
|
|
bVar2 = true;
|
|
break;
|
|
}
|
|
uVar10 = uVar10 + 1;
|
|
piVar8 = piVar8 + 8;
|
|
} while (uVar10 < 4);
|
|
do {
|
|
if (uVar5 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar5 = uVar5 >> ((byte)rngShift1 & 0x1f) ^ uVar5;
|
|
uVar5 = uVar5 << ((byte)local_44 & 0x1f) ^ uVar5;
|
|
uVar5 = uVar5 >> ((byte)local_34 & 0x1f) ^ uVar5;
|
|
uVar10 = uVar5 % 100;
|
|
if (uVar10 == 0) {
|
|
iVar7 = 3;
|
|
}
|
|
else if (uVar10 == 1) {
|
|
iVar7 = 4;
|
|
}
|
|
else if (uVar10 < 0xf) {
|
|
iVar7 = 0;
|
|
}
|
|
else if (uVar10 < 0x19) {
|
|
iVar7 = 1;
|
|
}
|
|
else {
|
|
iVar7 = (-GHIDRA_UINT((uVar10 < 0x23)) & 6) + 2;
|
|
}
|
|
local_54 = &game->_itemPool;
|
|
if (uVar5 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar5 = uVar5 >> ((byte)rngShift1 & 0x1f) ^ uVar5;
|
|
uVar5 = uVar5 << ((byte)local_44 & 0x1f) ^ uVar5;
|
|
local_50 = uVar5 >> ((byte)local_34 & 0x1f) ^ uVar5;
|
|
iVar7 = ItemPool::GetCollectible(local_54,iVar7,local_50,0,0,0);
|
|
if ((((iVar7 != 0) &&
|
|
(pvVar12 = (g_manager->_itemConfig)._collectibles._begin,
|
|
iVar7 < GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar12) >> 2)) &&
|
|
(iVar7 != 0xeb)) && ((iVar7 != 0x2b && (iVar7 != 0x3d)))) {
|
|
if (g_game == GHIDRA_CAST<Game *>(0x0)) {
|
|
if (-1 < iVar7) goto LAB_006f6c78;
|
|
}
|
|
else {
|
|
if (iVar7 < 0) {
|
|
iVar11 = -1 - iVar7;
|
|
if ((iVar11 < 0) ||
|
|
(proceduralItems = (g_game->_proceduralItemManager)._proceduralItems._begin,
|
|
GHIDRA_INT((g_game->_proceduralItemManager)._proceduralItems._end) -
|
|
GHIDRA_INT(proceduralItems) >> 2 <= iVar11)) {
|
|
iVar11 = 0;
|
|
}
|
|
else {
|
|
iVar11 = **GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(proceduralItems) + iVar11 * 4));
|
|
}
|
|
}
|
|
else {
|
|
LAB_006f6c78:
|
|
iVar11 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar12) + iVar7 * 4));
|
|
}
|
|
if (iVar11 != 0) {
|
|
if (g_game == GHIDRA_CAST<Game *>(0x0)) {
|
|
if (-1 < iVar7) goto LAB_006f6cb6;
|
|
}
|
|
else {
|
|
if (iVar7 < 0) {
|
|
iVar11 = -1 - iVar7;
|
|
if ((iVar11 < 0) ||
|
|
(pvVar12 = (g_game->_proceduralItemManager)._proceduralItems._begin,
|
|
GHIDRA_INT((g_game->_proceduralItemManager)._proceduralItems._end) - GHIDRA_INT(pvVar12)
|
|
>> 2 <= iVar11)) {
|
|
piVar8 = GHIDRA_CAST<int *>(0x0);
|
|
}
|
|
else {
|
|
piVar8 = GHIDRA_CAST<int *>(**GHIDRA_CAST<undefined4 **>((GHIDRA_CAST<char *>(pvVar12) + iVar11 * 4)));
|
|
}
|
|
}
|
|
else {
|
|
LAB_006f6cb6:
|
|
piVar8 = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(pvVar12) + iVar7 * 4));
|
|
}
|
|
if ((piVar8 != GHIDRA_CAST<int *>(0x0)) &&
|
|
(bVar3 = (GHIDRA_CAST<Item *>((piVar8)))->Item::IsAvailable(0xffffffff), bVar3 != 0)) {
|
|
if (*piVar8 == 3) {
|
|
if (bVar2) goto LAB_006f6d10;
|
|
bVar2 = true;
|
|
}
|
|
Entity_Player::AddCollectible(GHIDRA_CAST<Entity_Player *>(*newPlayerIt),iVar7,-1,1,0,0,0);
|
|
ItemPool::RemoveCollectible(&g_game->_itemPool,iVar7,0,0);
|
|
local_28 = GHIDRA_CAST<Game *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_28[-1]._console)) + 0x3))));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
LAB_006f6d10:
|
|
game = g_game;
|
|
uVar5 = local_50;
|
|
} while (0 < GHIDRA_INT(local_28));
|
|
}
|
|
manager = g_manager;
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("Setting PersistentGameData ReadOnly to %s\n"));
|
|
(manager->_persistentGameData)._isReadOnly = 0;
|
|
}
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 8;
|
|
if (((local_5c != GHIDRA_CAST<int *>(0x0)) && (cVar4 = (**(code **)(*local_5c + 0xc))(), cVar4 != '\0')) &&
|
|
(g_inputDeviceRelease != (void *)0x0)) {
|
|
(*g_inputDeviceRelease)(&local_60);
|
|
}
|
|
newPlayerIt = newPlayerIt + 1;
|
|
local_8 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_8))) + 0x1))) << 8;
|
|
} while (newPlayerIt != newPlayersEnd);
|
|
}
|
|
if (local_2c != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
uVar5 = GHIDRA_INT(newPlayersCapacity) - GHIDRA_INT(local_2c) & 0xfffffffc;
|
|
pEVar6 = local_2c;
|
|
if (0xfff < uVar5) {
|
|
pEVar6 = *GHIDRA_CAST<Entity_Player **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_2c[-1])) + 0x2efc))));
|
|
uVar5 = uVar5 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(local_2c) + (-4 - GHIDRA_INT(pEVar6))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pEVar6,uVar5);
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 006f6dd0
|
|
void Game::StartDailyChallenge(DailyChallenge *daily)
|
|
{
|
|
Game *game = this;
|
|
code *pcVar1;
|
|
std_string seed;
|
|
Game *seedEffectSet;
|
|
byte *extraout_EAX;
|
|
void *pvVar2;
|
|
uint uVar3;
|
|
byte *filename;
|
|
undefined4 *playerIt;
|
|
std_string asStackY_c98 [128];
|
|
undefined4 in_stack_ffffff80;
|
|
undefined4 in_stack_ffffff84;
|
|
undefined4 in_stack_ffffff88;
|
|
undefined4 uVar4;
|
|
void *itemPoolPath [4];
|
|
uint itemPoolPathSize;
|
|
uint itemPoolPathCapacity;
|
|
undefined1 tmpString [8];
|
|
char acStack_28 [4];
|
|
undefined4 *puStack_24;
|
|
undefined4 *puStack_20;
|
|
uint tmpStringCapacity;
|
|
uint local_18;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 uStack_8;
|
|
Manager *manager;
|
|
undefined4 *playersEnd;
|
|
_Tree_node<unsigned_int,void*> *seedEffectRoot;
|
|
void **seedEffectSet;
|
|
|
|
seedEffectSet = g_game;
|
|
uStack_8 = 0xffffffff;
|
|
puStack_c = &LAB_00afbf35;
|
|
local_10 = ExceptionList;
|
|
local_18 = __security_cookie ^ GHIDRA_UINT((tmpString + 0x2c));
|
|
ExceptionList = &local_10;
|
|
g_game->_isStarted = 1;
|
|
seedEffectSet->_difficulty = (daily->_params)._difficulty;
|
|
manager = g_manager;
|
|
seedEffectSet->_challenge = 0;
|
|
seedEffectSet->_isConsoleUsedThisRun = manager->_isConsoleEnabled;
|
|
(GHIDRA_CAST<HUD *>((&seedEffectSet->_hud)))->HUD::LoadGraphics();
|
|
(seedEffectSet->_dailyChallenge)._id = daily->_id;
|
|
(seedEffectSet->_dailyChallenge)._seed = daily->_seed;
|
|
(seedEffectSet->_dailyChallenge)._isPractice = daily->_isPractice;
|
|
(seedEffectSet->_dailyChallenge)._specialDailyId = daily->_specialDailyId;
|
|
daily_challenge_params_assign(&(seedEffectSet->_dailyChallenge)._params,&daily->_params);
|
|
seedEffectSet = &(seedEffectSet->_seedEffects)._seedEffects;
|
|
(seedEffectSet->_seedEffects)._gameStartSeed = 0;
|
|
pvVar2 = *seedEffectSet;
|
|
(seedEffectSet->_seedEffects)._isCustomRun = 0;
|
|
seedEffectRoot = *(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(pvVar2) + 4);
|
|
uVar4 = 0x6f6e9a;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<std::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(seedEffectSet,(fuzzer_allocator<std::_Tree_node<unsigned_int,void*>_> *)seedEffectSet,
|
|
seedEffectRoot);
|
|
*(void **)(GHIDRA_CAST<char *>(pvVar2) + 4) = pvVar2;
|
|
*(void **)pvVar2 = pvVar2;
|
|
*(void **)(GHIDRA_CAST<char *>(pvVar2) + 8) = pvVar2;
|
|
(seedEffectSet->_seedEffects)._seedEffectsCount = 0;
|
|
(seedEffectSet->_seedEffects)._isCustomRun = 1;
|
|
Seeds::Seed2String(asStackY_c98 + 0x81,daily->_seed);
|
|
seed._buf[4] = (char)in_stack_ffffff84;
|
|
seed._buf[5] = (char)(GHIDRA_UINT(in_stack_ffffff84) >> 8);
|
|
seed._buf[6] = (char)(GHIDRA_UINT(in_stack_ffffff84) >> 0x10);
|
|
seed._buf[7] = (char)(GHIDRA_UINT(in_stack_ffffff84) >> 0x18);
|
|
seed._buf[0] = (char)in_stack_ffffff80;
|
|
seed._buf[1] = (char)(GHIDRA_UINT(in_stack_ffffff80) >> 8);
|
|
seed._buf[2] = (char)(GHIDRA_UINT(in_stack_ffffff80) >> 0x10);
|
|
seed._buf[3] = (char)(GHIDRA_UINT(in_stack_ffffff80) >> 0x18);
|
|
seed._buf[8] = (char)in_stack_ffffff88;
|
|
seed._buf[9] = (char)(GHIDRA_UINT(in_stack_ffffff88) >> 8);
|
|
seed._buf[10] = (char)(GHIDRA_UINT(in_stack_ffffff88) >> 0x10);
|
|
seed._buf[0xb] = (char)(GHIDRA_UINT(in_stack_ffffff88) >> 0x18);
|
|
seed._buf[0xc] = (char)uVar4;
|
|
seed._buf[0xd] = (char)(GHIDRA_UINT(uVar4) >> 8);
|
|
seed._buf[0xe] = (char)(GHIDRA_UINT(uVar4) >> 0x10);
|
|
seed._buf[0xf] = (char)(GHIDRA_UINT(uVar4) >> 0x18);
|
|
seed._size = GHIDRA_UINT(seedEffectSet);
|
|
seed._capacity = GHIDRA_UINT(seedEffectRoot);
|
|
(GHIDRA_CAST<Seeds *>((&seedEffectSet->_seedEffects)))->Seeds::SetStartSeed(seed);
|
|
uVar3 = 0;
|
|
if (GHIDRA_INT((daily->_params)._seedEffects._end) - GHIDRA_INT((daily->_params)._seedEffects._begin) >> 2 != 0)
|
|
{
|
|
do {
|
|
Seeds::AddSeedEffect
|
|
(&seedEffectSet->_seedEffects,
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT((daily->_params)._seedEffects._begin) + uVar3 * 4)));
|
|
uVar3 = uVar3 + 1;
|
|
} while (uVar3 < GHIDRA_UINT((GHIDRA_INT((daily->_params)._seedEffects._end) -
|
|
GHIDRA_INT((daily->_params)._seedEffects._begin) >> 2)));
|
|
}
|
|
if ((seedEffectSet->_seedEffects)._gameStartSeed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Error: Game Start Seed was not set.\n"));
|
|
}
|
|
uVar3 = (seedEffectSet->_seedEffects)._rng._seed;
|
|
if (uVar3 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
uVar3 = (seedEffectSet->_seedEffects)._rng._seed;
|
|
if (uVar3 == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
manager = g_manager;
|
|
uVar3 = uVar3 >> ((byte)(seedEffectSet->_seedEffects)._rng._shift1 & 0x1f) ^ uVar3;
|
|
uVar3 = uVar3 << ((byte)(seedEffectSet->_seedEffects)._rng._shift2 & 0x1f) ^ uVar3;
|
|
uVar3 = uVar3 >> ((byte)(seedEffectSet->_seedEffects)._rng._shift3 & 0x1f) ^ uVar3;
|
|
(seedEffectSet->_seedEffects)._rng._seed = uVar3;
|
|
(seedEffectSet->_fortuneRNG)._seed = uVar3;
|
|
(seedEffectSet->_fortuneRNG)._shift1 = 5;
|
|
(seedEffectSet->_fortuneRNG)._shift2 = 9;
|
|
(seedEffectSet->_fortuneRNG)._shift3 = 7;
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("Setting PersistentGameData ReadOnly to %s\n"));
|
|
(manager->_persistentGameData)._isReadOnly = 1;
|
|
uVar3 = (seedEffectSet->_seedEffects)._gameStartSeed;
|
|
if (uVar3 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Error: Game Start Seed was not set.\n"));
|
|
uVar3 = (seedEffectSet->_seedEffects)._gameStartSeed;
|
|
}
|
|
if (uVar3 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Error: Game Start Seed was not set.\n"));
|
|
uVar3 = (seedEffectSet->_seedEffects)._gameStartSeed;
|
|
}
|
|
Seeds::Seed2String(GHIDRA_CAST<std_string *>(tmpString),uVar3);
|
|
uStack_8 = 0;
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("RNG Start Seed: %s (%u) [Daily, %d]\n"));
|
|
uStack_8 = 0xffffffff;
|
|
if (0xf < tmpStringCapacity) {
|
|
uVar3 = tmpStringCapacity + 1;
|
|
pvVar2 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)tmpString)) + 0x0)));
|
|
if (0xfff < uVar3) {
|
|
pvVar2 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString)) + 0x0))) + -4);
|
|
uVar3 = tmpStringCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString)) + 0x0))) + (-4 - GHIDRA_INT(pvVar2))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar2,uVar3);
|
|
}
|
|
puStack_20 = GHIDRA_CAST<undefined4 *>(0x0);
|
|
tmpStringCapacity = 0xf;
|
|
tmpString = (undefined1 [8])((ulonglong)tmpString & 0xffffffffffffff00);
|
|
init_procedural_item_surfaces(&seedEffectSet->_proceduralItemManager);
|
|
builtin_strncpy(acStack_28,"s.xm",4);
|
|
tmpStringCapacity = 0xf;
|
|
puStack_20 = GHIDRA_CAST<undefined4 *>(&DAT_0000000d);
|
|
tmpString = (undefined1 [8])0x6c6f6f706d657469;
|
|
puStack_24 = GHIDRA_CAST<undefined4 *>(CONCAT22((*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(&(puStack_24)) + 0x2))),0x6c));
|
|
uStack_8 = 1;
|
|
ModManager::TryRedirectPath
|
|
(&g_manager->_modManager,GHIDRA_CAST<std_string *>(itemPoolPath),GHIDRA_CAST<std_string *>(tmpString));
|
|
uStack_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uStack_8)) + 0x1))),2);
|
|
filename = extraout_EAX;
|
|
if (0xf < *GHIDRA_CAST<uint *>((extraout_EAX + 0x14))) {
|
|
filename = *GHIDRA_CAST<byte **>(extraout_EAX);
|
|
}
|
|
if ((seedEffectSet->_seedEffects)._gameStartSeed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Error: Game Start Seed was not set.\n"));
|
|
}
|
|
uVar3 = (seedEffectSet->_seedEffects)._rng._seed;
|
|
if (uVar3 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
uVar3 = (seedEffectSet->_seedEffects)._rng._seed;
|
|
if (uVar3 == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
uVar3 = uVar3 >> ((byte)(seedEffectSet->_seedEffects)._rng._shift1 & 0x1f) ^ uVar3;
|
|
uVar3 = uVar3 << ((byte)(seedEffectSet->_seedEffects)._rng._shift2 & 0x1f) ^ uVar3;
|
|
uVar3 = uVar3 >> ((byte)(seedEffectSet->_seedEffects)._rng._shift3 & 0x1f) ^ uVar3;
|
|
(seedEffectSet->_seedEffects)._rng._seed = uVar3;
|
|
(GHIDRA_CAST<ItemPool *>((&seedEffectSet->_itemPool)))->ItemPool::Init(uVar3,filename);
|
|
uStack_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uStack_8)) + 0x1))),1);
|
|
if (0xf < itemPoolPathCapacity) {
|
|
uVar3 = itemPoolPathCapacity + 1;
|
|
pvVar2 = itemPoolPath[0];
|
|
if (0xfff < uVar3) {
|
|
pvVar2 = *(void **)(GHIDRA_INT(itemPoolPath[0]) + -4);
|
|
uVar3 = itemPoolPathCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(itemPoolPath[0]) + (-4 - GHIDRA_INT(pvVar2))))) goto LAB_006f71ce;
|
|
}
|
|
operator_delete(pvVar2,uVar3);
|
|
}
|
|
uStack_8 = 0xffffffff;
|
|
itemPoolPathSize = 0;
|
|
itemPoolPathCapacity = 0xf;
|
|
itemPoolPath[0] = (void *)(GHIDRA_UINT(itemPoolPath[0]) & 0xffffff00);
|
|
if (0xf < tmpStringCapacity) {
|
|
uVar3 = tmpStringCapacity + 1;
|
|
pvVar2 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)tmpString)) + 0x0)));
|
|
if (0xfff < uVar3) {
|
|
pvVar2 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString)) + 0x0))) + -4);
|
|
uVar3 = tmpStringCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString)) + 0x0))) + (-4 - GHIDRA_INT(pvVar2))))) {
|
|
LAB_006f71ce:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar2,uVar3);
|
|
}
|
|
uVar3 = (seedEffectSet->_seedEffects)._gameStartSeed;
|
|
if (uVar3 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Error: Game Start Seed was not set.\n"));
|
|
uVar3 = (seedEffectSet->_seedEffects)._gameStartSeed;
|
|
}
|
|
(GHIDRA_CAST<BossPool *>((&seedEffectSet->_bossPool)))->BossPool::init(uVar3);
|
|
if ((seedEffectSet->_seedEffects)._gameStartSeed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Error: Game Start Seed was not set.\n"));
|
|
}
|
|
PlayerManager::init_main_player
|
|
(&seedEffectSet->_playerManager,(daily->_params)._playerType,
|
|
(seedEffectSet->_seedEffects)._playerInitSeed);
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(seedEffectSet))))->Level::SetNextStage();
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(seedEffectSet))))->Level::Init(1);
|
|
std::vector<int>::copy_constructor();
|
|
playersEnd = puStack_20;
|
|
uStack_8 = 3;
|
|
for (playerIt = puStack_24; playerIt != playersEnd; playerIt = playerIt + 1) {
|
|
if ((GHIDRA_CAST<Entity_Player *>(*playerIt))->_variant == 0) {
|
|
(GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(*playerIt))))->Entity_Player::InitPostLevelInitStats();
|
|
}
|
|
}
|
|
uStack_8 = 0xffffffff;
|
|
FID_conflict__Tidy(&puStack_24);
|
|
(GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::trigger_new_room_effects();
|
|
tmpStringCapacity = 0;
|
|
tmpString = (undefined1 [8])((ulonglong)tmpString & 0xffffffff);
|
|
acStack_28[0] = '\0';
|
|
acStack_28[1] = '\0';
|
|
acStack_28[2] = '\0';
|
|
acStack_28[3] = '\0';
|
|
puStack_24 = GHIDRA_CAST<undefined4 *>(0x0);
|
|
puStack_20 = GHIDRA_CAST<undefined4 *>(0x3f800000);
|
|
Fadein(seedEffectSet,0.04,1,GHIDRA_CAST<KColor *>((tmpString + 4)));
|
|
FUN_009b5cb0();
|
|
LuaEngine::PostGameStart(0);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 006f72f0
|
|
void Game::StartFromRerunState(GameState *state)
|
|
{
|
|
void **hud;
|
|
byte bVar1;
|
|
Seeds *other;
|
|
uint seedValue;
|
|
byte *extraout_EAX;
|
|
int unusedArg;
|
|
void *pvVar2;
|
|
KColor *color;
|
|
byte *filename;
|
|
Seeds seedsCopy;
|
|
void *itemPoolsPath [4];
|
|
uint itemPoolsPathSize;
|
|
uint itemPoolsPathCapacity;
|
|
undefined1 auStack_30 [8];
|
|
char acStack_28 [8];
|
|
uint uStack_20;
|
|
uint uStack_1c;
|
|
uint local_18;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
HUD *hud;
|
|
Manager *manager;
|
|
Seeds *seeds;
|
|
Game *temp_3ff60c61d2;
|
|
Room *temp_5fd1250009;
|
|
|
|
temp_3ff60c61d2 = g_game;
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00afbf88;
|
|
local_10 = ExceptionList;
|
|
local_18 = __security_cookie ^ GHIDRA_UINT((auStack_30 + 0x2c));
|
|
ExceptionList = &local_10;
|
|
hud = &g_game->_hud;
|
|
g_game->_isStarted = 1;
|
|
(GHIDRA_CAST<HUD *>((hud)))->HUD::LoadGraphics();
|
|
temp_3ff60c61d2->_challenge = *GHIDRA_CAST<int *>(state);
|
|
if (((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x5))) == '\0') && (g_manager->_isConsoleEnabled == 0)) {
|
|
bVar1 = 0;
|
|
}
|
|
else {
|
|
bVar1 = 1;
|
|
}
|
|
temp_3ff60c61d2->_isConsoleUsedThisRun = bVar1;
|
|
temp_3ff60c61d2->_difficulty = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x8))));
|
|
temp_3ff60c61d2->_isRerun = 1;
|
|
(GHIDRA_CAST<Seeds *>((&seedsCopy)))->Seeds::construct_from_copy(GHIDRA_CAST<Seeds *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x1e724)))));
|
|
local_8 = 0;
|
|
(GHIDRA_CAST<Seeds *>((&temp_3ff60c61d2->_seedEffects)))->Seeds::operator_assign(other);
|
|
local_8 = 0xffffffff;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<std::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(&seedsCopy._seedEffects,
|
|
(fuzzer_allocator<std::_Tree_node<unsigned_int,void*>_> *)&seedsCopy._seedEffects,
|
|
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(seedsCopy._seedEffects) + 4));
|
|
operator_delete(seedsCopy._seedEffects,0x14);
|
|
pvVar2 = (temp_3ff60c61d2->_seedEffects)._seedEffects;
|
|
hud = &(temp_3ff60c61d2->_seedEffects)._seedEffects;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<std::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(hud,(fuzzer_allocator<std::_Tree_node<unsigned_int,void*>_> *)hud,
|
|
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(pvVar2) + 4));
|
|
*(void **)(GHIDRA_CAST<char *>(pvVar2) + 4) = pvVar2;
|
|
*(void **)pvVar2 = pvVar2;
|
|
*(void **)(GHIDRA_CAST<char *>(pvVar2) + 8) = pvVar2;
|
|
(temp_3ff60c61d2->_seedEffects)._seedEffectsCount = 0;
|
|
seeds = &temp_3ff60c61d2->_seedEffects;
|
|
seedValue = (GHIDRA_CAST<Seeds *>((seeds)))->Seeds::GetNextSeed();
|
|
(GHIDRA_CAST<Seeds *>((seeds)))->Seeds::set_start_seed(seedValue);
|
|
seedValue = (GHIDRA_CAST<Seeds *>((seeds)))->Seeds::GetNextSeed();
|
|
manager = g_manager;
|
|
(temp_3ff60c61d2->_fortuneRNG)._seed = seedValue;
|
|
(temp_3ff60c61d2->_fortuneRNG)._shift1 = 5;
|
|
(temp_3ff60c61d2->_fortuneRNG)._shift2 = 9;
|
|
(temp_3ff60c61d2->_fortuneRNG)._shift3 = 7;
|
|
if ((((seeds->_isCustomRun == 0) &&
|
|
(bVar1 = (GHIDRA_CAST<Seeds *>((seeds)))->Seeds::AchievementUnlocksDisallowed(), bVar1 == 0)) &&
|
|
(bVar1 = Manager::IsGameplayInputActive(unusedArg), bVar1 == 0)) &&
|
|
(temp_3ff60c61d2->_isRerun == 0)) {
|
|
bVar1 = 0;
|
|
}
|
|
else {
|
|
bVar1 = 1;
|
|
}
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("Setting PersistentGameData ReadOnly to %s\n"));
|
|
(manager->_persistentGameData)._isReadOnly = bVar1;
|
|
seedValue = (temp_3ff60c61d2->_seedEffects)._gameStartSeed;
|
|
if (seedValue == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Error: Game Start Seed was not set.\n"));
|
|
seedValue = (temp_3ff60c61d2->_seedEffects)._gameStartSeed;
|
|
}
|
|
if (seedValue == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Error: Game Start Seed was not set.\n"));
|
|
seedValue = (temp_3ff60c61d2->_seedEffects)._gameStartSeed;
|
|
}
|
|
Seeds::Seed2String(GHIDRA_CAST<std_string *>(auStack_30),seedValue);
|
|
local_8 = 1;
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("RNG Start Seed: %s (%u) [Rerun, %d]\n"));
|
|
local_8 = 0xffffffff;
|
|
if (0xf < uStack_1c) {
|
|
seedValue = uStack_1c + 1;
|
|
pvVar2 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)auStack_30)) + 0x0)));
|
|
if (0xfff < seedValue) {
|
|
pvVar2 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auStack_30)) + 0x0))) + -4);
|
|
seedValue = uStack_1c + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auStack_30)) + 0x0))) + (-4 - GHIDRA_INT(pvVar2))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar2,seedValue);
|
|
}
|
|
init_procedural_item_surfaces(&temp_3ff60c61d2->_proceduralItemManager);
|
|
builtin_strncpy(acStack_28,"s.xml",6);
|
|
uStack_1c = 0xf;
|
|
uStack_20 = 0xd;
|
|
auStack_30[0] = 'i';
|
|
auStack_30[1] = 't';
|
|
auStack_30[2] = 'e';
|
|
auStack_30[3] = 'm';
|
|
auStack_30[4] = 'p';
|
|
auStack_30[5] = 'o';
|
|
auStack_30[6] = 'o';
|
|
auStack_30[7] = 'l';
|
|
local_8 = 2;
|
|
ModManager::TryRedirectPath
|
|
(&g_manager->_modManager,GHIDRA_CAST<std_string *>(itemPoolsPath),GHIDRA_CAST<std_string *>(auStack_30));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 3;
|
|
filename = extraout_EAX;
|
|
if (0xf < *GHIDRA_CAST<uint *>((extraout_EAX + 0x14))) {
|
|
filename = *GHIDRA_CAST<byte **>(extraout_EAX);
|
|
}
|
|
seedValue = (GHIDRA_CAST<Seeds *>((seeds)))->Seeds::GetNextSeed();
|
|
(GHIDRA_CAST<ItemPool *>((&temp_3ff60c61d2->_itemPool)))->ItemPool::Init(seedValue,filename);
|
|
local_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),2);
|
|
if (0xf < itemPoolsPathCapacity) {
|
|
seedValue = itemPoolsPathCapacity + 1;
|
|
pvVar2 = itemPoolsPath[0];
|
|
if (0xfff < seedValue) {
|
|
pvVar2 = *(void **)(GHIDRA_INT(itemPoolsPath[0]) + -4);
|
|
seedValue = itemPoolsPathCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(itemPoolsPath[0]) + (-4 - GHIDRA_INT(pvVar2))))) goto LAB_006f7624;
|
|
}
|
|
operator_delete(pvVar2,seedValue);
|
|
}
|
|
local_8 = 0xffffffff;
|
|
itemPoolsPathSize = 0;
|
|
itemPoolsPathCapacity = 0xf;
|
|
itemPoolsPath[0] = (void *)(GHIDRA_UINT(itemPoolsPath[0]) & 0xffffff00);
|
|
if (0xf < uStack_1c) {
|
|
seedValue = uStack_1c + 1;
|
|
pvVar2 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)auStack_30)) + 0x0)));
|
|
if (0xfff < seedValue) {
|
|
pvVar2 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auStack_30)) + 0x0))) + -4);
|
|
seedValue = uStack_1c + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auStack_30)) + 0x0))) + (-4 - GHIDRA_INT(pvVar2))))) {
|
|
LAB_006f7624:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar2,seedValue);
|
|
}
|
|
seedValue = (temp_3ff60c61d2->_seedEffects)._gameStartSeed;
|
|
if (seedValue == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Error: Game Start Seed was not set.\n"));
|
|
seedValue = (temp_3ff60c61d2->_seedEffects)._gameStartSeed;
|
|
}
|
|
(GHIDRA_CAST<BossPool *>((&temp_3ff60c61d2->_bossPool)))->BossPool::init(seedValue);
|
|
if ((temp_3ff60c61d2->_seedEffects)._gameStartSeed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Error: Game Start Seed was not set.\n"));
|
|
}
|
|
PlayerManager::init_main_player
|
|
(&temp_3ff60c61d2->_playerManager,*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x19d7c)))),
|
|
(temp_3ff60c61d2->_seedEffects)._playerInitSeed);
|
|
(GHIDRA_CAST<PlayerManager *>((&temp_3ff60c61d2->_playerManager)))->PlayerManager::RestoreGameState(state);
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(temp_3ff60c61d2))))->Level::SetNextStage();
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(temp_3ff60c61d2))))->Level::Init(1);
|
|
(GHIDRA_CAST<PlayerManager *>((&temp_3ff60c61d2->_playerManager)))->PlayerManager::RestoreGameState_PostLevelInit(state);
|
|
Manager::save_game_state();
|
|
(GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::trigger_new_room_effects();
|
|
FUN_009b5cb0();
|
|
temp_5fd1250009 = temp_3ff60c61d2->_room;
|
|
*GHIDRA_CAST<undefined4 *>((temp_3ff60c61d2->_encounteredBosses + 4)) =
|
|
*GHIDRA_CAST<undefined4 *>(temp_3ff60c61d2->_encounteredBosses);
|
|
(GHIDRA_CAST<Room *>((temp_5fd1250009)))->Room::Update();
|
|
(GHIDRA_CAST<KColor *>((GHIDRA_CAST<KColor *>((auStack_30 + 4)))))->KColor::SetFromARGB(0xff000000);
|
|
Fadein(temp_3ff60c61d2,0.04,1,color);
|
|
temp_3ff60c61d2->_framesSinceRoomTransition = 0;
|
|
LuaEngine::PostGameStart(1);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 006f7750
|
|
void Game::StartDebug(int levelStage, int stageType, int difficulty, std_string roomFile)
|
|
{
|
|
Game *game = this;
|
|
std_string seed;
|
|
undefined1 auVar1 [20];
|
|
Game *this_00;
|
|
byte isReadOnly;
|
|
byte *extraout_EAX;
|
|
uint uVar2;
|
|
int unusedArg;
|
|
int iVar3;
|
|
void *freeBlock;
|
|
int extraout_ECX;
|
|
int extraout_ECX_00;
|
|
byte *itemPoolPath;
|
|
undefined4 in_stack_ffffff8c;
|
|
undefined4 in_stack_ffffff90;
|
|
undefined4 in_stack_ffffff94;
|
|
void *redirectedPath [4];
|
|
uint redirectedPathSize;
|
|
uint redirectedPathCapacity;
|
|
std_string itemPoolFile;
|
|
uint local_18;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
void *local_8;
|
|
Manager *manager;
|
|
|
|
manager = g_manager;
|
|
this_00 = g_game;
|
|
puStack_c = &LAB_00afbfe9;
|
|
local_10 = ExceptionList;
|
|
local_18 = __security_cookie ^ GHIDRA_UINT((redirectedPath + 0x11));
|
|
ExceptionList = &local_10;
|
|
local_8 = (void *)0x0;
|
|
g_game->_isStarted = 1;
|
|
this_00->_isConsoleUsedThisRun = manager->_isConsoleEnabled;
|
|
this_00->_difficulty = difficulty;
|
|
this_00->_isDebug = 1;
|
|
(this_00->_seedEffects)._isCustomRun = 1;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar1)) + 0x4))) = in_stack_ffffff90;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar1)) + 0x0))) = in_stack_ffffff8c;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar1)) + 0x8))) = in_stack_ffffff94;
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(auVar1)) + 0xc))) = 0;
|
|
auVar1 = auVar1 << 0x20;
|
|
seed._capacity = 0xf;
|
|
seed._buf[0] = auVar1[0];
|
|
seed._buf[1] = auVar1[1];
|
|
seed._buf[2] = auVar1[2];
|
|
seed._buf[3] = auVar1[3];
|
|
seed._buf[4] = auVar1[4];
|
|
seed._buf[5] = auVar1[5];
|
|
seed._buf[6] = auVar1[6];
|
|
seed._buf[7] = auVar1[7];
|
|
seed._buf[8] = auVar1[8];
|
|
seed._buf[9] = auVar1[9];
|
|
seed._buf[10] = auVar1[10];
|
|
seed._buf[0xb] = auVar1[0xb];
|
|
seed._buf[0xc] = auVar1[0xc];
|
|
seed._buf[0xd] = auVar1[0xd];
|
|
seed._buf[0xe] = auVar1[0xe];
|
|
seed._buf[0xf] = auVar1[0xf];
|
|
seed._size = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auVar1)) + 0x10)));
|
|
(GHIDRA_CAST<Seeds *>((&this_00->_seedEffects)))->Seeds::SetStartSeed(seed);
|
|
manager = g_manager;
|
|
if (((((this_00->_seedEffects)._isCustomRun == 0) &&
|
|
(isReadOnly = (GHIDRA_CAST<Seeds *>((&this_00->_seedEffects)))->Seeds::AchievementUnlocksDisallowed(), isReadOnly == 0))
|
|
&& (isReadOnly = Manager::IsGameplayInputActive(unusedArg), isReadOnly == 0)) &&
|
|
(this_00->_isRerun == 0)) {
|
|
isReadOnly = 0;
|
|
}
|
|
else {
|
|
isReadOnly = 1;
|
|
}
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("Setting PersistentGameData ReadOnly to %s\n"));
|
|
(manager->_persistentGameData)._isReadOnly = isReadOnly;
|
|
(GHIDRA_CAST<HUD *>((&this_00->_hud)))->HUD::LoadGraphics();
|
|
this_00->_challenge = 0;
|
|
init_procedural_item_surfaces(&this_00->_proceduralItemManager);
|
|
builtin_strncpy(itemPoolFile._buf + 8,"s.xml",6);
|
|
itemPoolFile._capacity = 0xf;
|
|
itemPoolFile._size = 0xd;
|
|
builtin_strncpy(itemPoolFile._buf,"itempool",8);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
|
|
(GHIDRA_CAST<ModManager *>((&g_manager->_modManager)))->ModManager::TryRedirectPath(GHIDRA_CAST<std_string *>(redirectedPath),&itemPoolFile);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 2;
|
|
itemPoolPath = extraout_EAX;
|
|
if (0xf < *GHIDRA_CAST<uint *>((extraout_EAX + 0x14))) {
|
|
itemPoolPath = *GHIDRA_CAST<byte **>(extraout_EAX);
|
|
}
|
|
uVar2 = (GHIDRA_CAST<Seeds *>((&this_00->_seedEffects)))->Seeds::GetNextSeed();
|
|
(GHIDRA_CAST<ItemPool *>((&this_00->_itemPool)))->ItemPool::Init(uVar2,itemPoolPath);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
|
|
if (0xf < redirectedPathCapacity) {
|
|
uVar2 = redirectedPathCapacity + 1;
|
|
freeBlock = redirectedPath[0];
|
|
if (0xfff < uVar2) {
|
|
freeBlock = *(void **)(GHIDRA_INT(redirectedPath[0]) + -4);
|
|
uVar2 = redirectedPathCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(redirectedPath[0]) + (-4 - GHIDRA_INT(freeBlock))))) goto LAB_006f793a;
|
|
}
|
|
operator_delete(freeBlock,uVar2);
|
|
}
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0;
|
|
redirectedPathSize = 0;
|
|
redirectedPathCapacity = 0xf;
|
|
redirectedPath[0] = (void *)(GHIDRA_UINT(redirectedPath[0]) & 0xffffff00);
|
|
if (0xf < itemPoolFile._capacity) {
|
|
uVar2 = itemPoolFile._capacity + 1;
|
|
freeBlock = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)itemPoolFile._buf)) + 0x0)));
|
|
if (0xfff < uVar2) {
|
|
freeBlock = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(itemPoolFile._buf)) + 0x0))) + -4);
|
|
uVar2 = itemPoolFile._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(itemPoolFile._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
|
|
LAB_006f793a:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freeBlock,uVar2);
|
|
}
|
|
uVar2 = (this_00->_seedEffects)._gameStartSeed;
|
|
if (uVar2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Error: Game Start Seed was not set.\n"));
|
|
uVar2 = (this_00->_seedEffects)._gameStartSeed;
|
|
}
|
|
(GHIDRA_CAST<BossPool *>((&this_00->_bossPool)))->BossPool::init(uVar2);
|
|
if ((this_00->_seedEffects)._gameStartSeed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Error: Game Start Seed was not set.\n"));
|
|
}
|
|
PlayerManager::init_main_player
|
|
(&this_00->_playerManager,0,(this_00->_seedEffects)._playerInitSeed);
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(this_00))))->Level::SetStage(levelStage,stageType);
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(this_00))))->Level::Init(1);
|
|
if (roomFile._size != 0) {
|
|
iVar3 = *GHIDRA_CAST<int *>(ThreadLocalStoragePointer);
|
|
if ((*GHIDRA_CAST<int *>((iVar3 + 0xc)) < DAT_00c80e44) &&
|
|
(_Init_thread_header(&DAT_00c80e44), iVar3 = extraout_ECX, DAT_00c80e44 == -1)) {
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 3;
|
|
RoomConfig::LoadRoomFromXmlFile();
|
|
_atexit(GHIDRA_CAST<_func_4879 *>(&LAB_00b159c0));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0;
|
|
_Init_thread_footer(&DAT_00c80e44);
|
|
iVar3 = extraout_ECX_00;
|
|
}
|
|
_DAT_00c80e48 = GetStageID(this_00,(byte)iVar3);
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::DEBUG_goto_room(GHIDRA_CAST<RoomConfig_Room *>(&DAT_00c80e48));
|
|
}
|
|
FUN_009ba9a0();
|
|
(GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::trigger_new_room_effects();
|
|
LuaEngine::PostGameStart(0);
|
|
if (0xf < roomFile._capacity) {
|
|
uVar2 = roomFile._capacity + 1;
|
|
freeBlock = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)roomFile._buf)) + 0x0)));
|
|
if (0xfff < uVar2) {
|
|
freeBlock = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(roomFile._buf)) + 0x0))) + -4);
|
|
uVar2 = roomFile._capacity + 0x24;
|
|
if (0x1f < ((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(roomFile._buf)) + 0x0))) - GHIDRA_INT(freeBlock)) - 4U) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freeBlock,uVar2);
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 006f7ac0
|
|
void Game::NextVictoryLap()
|
|
{
|
|
uint *puVar1;
|
|
code *pcVar2;
|
|
qword qVar3;
|
|
char cVar4;
|
|
uint uVar5;
|
|
byte *extraout_EAX;
|
|
void *pvVar6;
|
|
int *piVar7;
|
|
byte *filename;
|
|
int iVar8;
|
|
void *redirectedPath [4];
|
|
uint redirectedPathSize;
|
|
uint redirectedPathCapacity;
|
|
undefined1 auStack_44 [16];
|
|
int *local_34;
|
|
int *local_30;
|
|
void *seedString;
|
|
KColor KStack_28;
|
|
uint local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
void *local_8;
|
|
Game *game;
|
|
bool isLobbyActive;
|
|
Manager *manager;
|
|
|
|
puStack_c = &LAB_00afc04d;
|
|
local_10 = ExceptionList;
|
|
uVar5 = __security_cookie ^ GHIDRA_UINT((redirectedPath + 0x16));
|
|
ExceptionList = &local_10;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auStack_44)) + 0xc))) = KAGE::Network::Multiplayer::ConstLobby::vftable;
|
|
local_34 = GHIDRA_CAST<int *>(0x0);
|
|
local_30 = GHIDRA_CAST<int *>(0x0);
|
|
local_8 = (void *)0x0;
|
|
local_14 = uVar5;
|
|
(GHIDRA_CAST<std::shared_ptr *>((auStack_44 + 0x10)))->std::shared_ptr::assign(&g_multiplayerLobbyPtr);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auStack_44)) + 0xc))) = KAGE::Network::Multiplayer::Lobby::vftable;
|
|
local_8 = (void *)0x1;
|
|
if ((local_34 == GHIDRA_CAST<int *>(0x0)) || (cVar4 = (**(code **)(*local_34 + 0xc))(uVar5), cVar4 == '\0')) {
|
|
isLobbyActive = false;
|
|
}
|
|
else {
|
|
isLobbyActive = true;
|
|
}
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auStack_44)) + 0xc))) = KAGE::Network::Multiplayer::ConstLobby::vftable;
|
|
local_8 = (void *)0x2;
|
|
if (((local_30 != GHIDRA_CAST<int *>(0x0)) && (cVar4 = (**(code **)(*local_30 + 0xc))(), cVar4 != '\0')) &&
|
|
(g_lobbyReleaseFn != (void *)0x0)) {
|
|
(*g_lobbyReleaseFn)(auStack_44 + 0x10);
|
|
}
|
|
if (isLobbyActive) {
|
|
KStack_28._blue = 1.7059066e-38;
|
|
KStack_28._alpha = 0.0;
|
|
KStack_28._unk = 0;
|
|
local_8 = (void *)0x3;
|
|
(GHIDRA_CAST<std::shared_ptr *>((&KStack_28._alpha)))->std::shared_ptr::assign(&g_multiplayerLobbyPtr);
|
|
KStack_28._blue = (float)KAGE::Network::Multiplayer::Lobby::vftable;
|
|
local_8 = (void *)0x4;
|
|
if (GHIDRA_CAST<int *>(KStack_28._alpha) != GHIDRA_CAST<int *>(0x0)) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(KStack_28._alpha) + 0x38))(0);
|
|
}
|
|
KStack_28._blue = (float)KAGE::Network::Multiplayer::ConstLobby::vftable;
|
|
local_8 = (void *)0x5;
|
|
if (((GHIDRA_CAST<int *>(KStack_28._unk) != GHIDRA_CAST<int *>(0x0)) &&
|
|
(cVar4 = (**(code **)(*GHIDRA_CAST<int *>(KStack_28._unk) + 0xc))(), cVar4 != '\0')) &&
|
|
(g_lobbyReleaseFn != (void *)0x0)) {
|
|
(*g_lobbyReleaseFn)(&KStack_28._alpha);
|
|
}
|
|
}
|
|
manager = g_manager;
|
|
local_8 = (void *)0xffffffff;
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("Setting PersistentGameData ReadOnly to %s\n"));
|
|
(manager->_persistentGameData)._isReadOnly = 1;
|
|
this->_victoryLap = this->_victoryLap + 1;
|
|
if (this->_victoryLap == 1) {
|
|
this->_difficulty = 1;
|
|
}
|
|
pvVar6 = (this->_playerManager)._playerList._end;
|
|
uVar5 = 0;
|
|
piVar7 = (this->_playerManager)._playerList._begin;
|
|
if (GHIDRA_INT(pvVar6) - GHIDRA_INT(piVar7) >> 2 != 0) {
|
|
do {
|
|
if (GHIDRA_INT(pvVar6) - GHIDRA_INT(piVar7) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
pvVar6 = (this->_playerManager)._playerList._end;
|
|
piVar7 = (this->_playerManager)._playerList._begin;
|
|
}
|
|
if (uVar5 < GHIDRA_UINT((GHIDRA_INT(pvVar6) - GHIDRA_INT(piVar7) >> 2))) {
|
|
piVar7 = piVar7 + uVar5;
|
|
}
|
|
if (*GHIDRA_CAST<int *>((*piVar7 + 0x2c)) == 0) {
|
|
iVar8 = (this->_seedEffects)._gameStartSeed;
|
|
if (iVar8 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Error: Game Start Seed was not set.\n"));
|
|
iVar8 = (this->_seedEffects)._gameStartSeed;
|
|
}
|
|
Entity_Player::apply_victory_lap_penalty(iVar8);
|
|
}
|
|
pvVar6 = (this->_playerManager)._playerList._end;
|
|
uVar5 = uVar5 + 1;
|
|
piVar7 = (this->_playerManager)._playerList._begin;
|
|
} while (uVar5 < GHIDRA_UINT((GHIDRA_INT(pvVar6) - GHIDRA_INT(piVar7) >> 2)));
|
|
}
|
|
qVar3 = this->_gameStateFlags;
|
|
puVar1 = GHIDRA_CAST<uint *>((GHIDRA_INT(&this->_gameStateFlags) + 4));
|
|
*puVar1 = *puVar1 & 0xfffdffff;
|
|
*GHIDRA_CAST<int *>(&this->_gameStateFlags) = GHIDRA_INT(qVar3);
|
|
uVar5 = (this->_seedEffects)._gameStartSeed;
|
|
if (uVar5 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Error: Game Start Seed was not set.\n"));
|
|
uVar5 = (this->_seedEffects)._gameStartSeed;
|
|
KStack_28._blue = 1.4013e-45;
|
|
KStack_28._alpha = 1.26117e-44;
|
|
if (uVar5 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
}
|
|
KStack_28._blue = 1.4013e-45;
|
|
KStack_28._alpha = 1.26117e-44;
|
|
uVar5 = uVar5 >> 1 ^ uVar5;
|
|
uVar5 = uVar5 << 9 ^ uVar5;
|
|
(GHIDRA_CAST<Seeds *>((&this->_seedEffects)))->Seeds::set_start_seed(uVar5 >> 0x1d ^ uVar5);
|
|
uVar5 = (GHIDRA_CAST<Seeds *>((&this->_seedEffects)))->Seeds::GetNextSeed();
|
|
(this->_fortuneRNG)._seed = uVar5;
|
|
(this->_fortuneRNG)._shift1 = 5;
|
|
(this->_fortuneRNG)._shift2 = 9;
|
|
(this->_fortuneRNG)._shift3 = 7;
|
|
uVar5 = (this->_seedEffects)._gameStartSeed;
|
|
if (uVar5 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Error: Game Start Seed was not set.\n"));
|
|
uVar5 = (this->_seedEffects)._gameStartSeed;
|
|
}
|
|
if (uVar5 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Error: Game Start Seed was not set.\n"));
|
|
uVar5 = (this->_seedEffects)._gameStartSeed;
|
|
}
|
|
Seeds::Seed2String(GHIDRA_CAST<std_string *>(&seedString),uVar5);
|
|
local_8 = (void *)0x6;
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("RNG Victory Lap Start Seed: %s (%u)\n"));
|
|
local_8 = (void *)0xffffffff;
|
|
if (&DAT_0000000f < GHIDRA_UINT(KStack_28._unk)) {
|
|
piVar7 = GHIDRA_CAST<int *>((KStack_28._unk + 1));
|
|
pvVar6 = seedString;
|
|
if (GHIDRA_CAST<int *>(0xfff) < piVar7) {
|
|
pvVar6 = *(void **)(GHIDRA_CAST<char *>(seedString) + -4);
|
|
piVar7 = GHIDRA_CAST<int *>((KStack_28._unk + 0x24));
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(seedString) + (-4 - GHIDRA_INT(pvVar6))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar6,GHIDRA_UINT(piVar7));
|
|
}
|
|
auStack_44[8] = 's';
|
|
auStack_44[9] = '.';
|
|
auStack_44[10] = 'x';
|
|
auStack_44[0xb] = 'm';
|
|
KStack_28._alpha = 0.0;
|
|
KStack_28._unk = 0xf;
|
|
seedString = (void *)(GHIDRA_UINT(seedString) & 0xffffff00);
|
|
local_30 = GHIDRA_CAST<int *>(0xf);
|
|
local_34 = GHIDRA_CAST<int *>(0xd);
|
|
auStack_44[0] = 'i';
|
|
auStack_44[1] = 't';
|
|
auStack_44[2] = 'e';
|
|
auStack_44[3] = 'm';
|
|
auStack_44[4] = 'p';
|
|
auStack_44[5] = 'o';
|
|
auStack_44[6] = 'o';
|
|
auStack_44[7] = 'l';
|
|
(*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(&(auStack_44)) + 0xc))) = 0x6c;
|
|
local_8 = (void *)0x7;
|
|
ModManager::TryRedirectPath
|
|
(&g_manager->_modManager,GHIDRA_CAST<std_string *>(redirectedPath),GHIDRA_CAST<std_string *>(auStack_44));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 8;
|
|
filename = extraout_EAX;
|
|
if (0xf < *GHIDRA_CAST<uint *>((extraout_EAX + 0x14))) {
|
|
filename = *GHIDRA_CAST<byte **>(extraout_EAX);
|
|
}
|
|
uVar5 = (GHIDRA_CAST<Seeds *>((&this->_seedEffects)))->Seeds::GetNextSeed();
|
|
(GHIDRA_CAST<ItemPool *>((&this->_itemPool)))->ItemPool::Init(uVar5,filename);
|
|
local_8 = (void *)CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),7);
|
|
if (0xf < redirectedPathCapacity) {
|
|
uVar5 = redirectedPathCapacity + 1;
|
|
pvVar6 = redirectedPath[0];
|
|
if (0xfff < uVar5) {
|
|
pvVar6 = *(void **)(GHIDRA_INT(redirectedPath[0]) + -4);
|
|
uVar5 = redirectedPathCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(redirectedPath[0]) + (-4 - GHIDRA_INT(pvVar6))))) goto LAB_006f7f31;
|
|
}
|
|
operator_delete(pvVar6,uVar5);
|
|
}
|
|
local_8 = (void *)0xffffffff;
|
|
redirectedPathSize = 0;
|
|
redirectedPathCapacity = 0xf;
|
|
redirectedPath[0] = (void *)(GHIDRA_UINT(redirectedPath[0]) & 0xffffff00);
|
|
if (0xf < local_30) {
|
|
uVar5 = GHIDRA_INT(local_30) + 1;
|
|
pvVar6 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)auStack_44)) + 0x0)));
|
|
if (0xfff < uVar5) {
|
|
pvVar6 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auStack_44)) + 0x0))) + -4);
|
|
uVar5 = GHIDRA_INT(local_30) + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(auStack_44)) + 0x0))) + (-4 - GHIDRA_INT(pvVar6))))) {
|
|
LAB_006f7f31:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar6,uVar5);
|
|
}
|
|
uVar5 = (this->_seedEffects)._gameStartSeed;
|
|
if (uVar5 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Error: Game Start Seed was not set.\n"));
|
|
uVar5 = (this->_seedEffects)._gameStartSeed;
|
|
}
|
|
(GHIDRA_CAST<BossPool *>((&this->_bossPool)))->BossPool::init(uVar5);
|
|
iVar8 = this->_stage;
|
|
if ((0 < iVar8) && ((6 < iVar8 || ((g_game->_gameStateFlags & 0x1000000000000) == 0)))) {
|
|
if ((this->_stageType == 4) || (this->_stageType == 5)) {
|
|
iVar8 = iVar8 + 1;
|
|
}
|
|
if (iVar8 < 8) {
|
|
SaveBackwardsStage(iVar8);
|
|
}
|
|
}
|
|
manager = g_manager;
|
|
game = g_game;
|
|
this->_stage = 0;
|
|
this->_stageType = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((manager)) + 0x21c10))) = 0;
|
|
if ((game->_difficulty == 2) || (game->_difficulty == 3)) {
|
|
iVar8 = -3;
|
|
}
|
|
else {
|
|
iVar8 = 0;
|
|
}
|
|
(manager->_nightmareScene)._stageBarIcons[0] = iVar8;
|
|
if ((((game->_difficulty == 2) || (game->_difficulty == 3)) || (6 < this->_stage)) ||
|
|
((this->_stageType != 4 && (this->_stageType != 5)))) {
|
|
game->_bossRushParTime = 36000;
|
|
}
|
|
else {
|
|
game->_bossRushParTime = 45000;
|
|
}
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(this))))->Level::SetNextStage();
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(this))))->Level::Init(1);
|
|
Manager::save_game_state();
|
|
(GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::trigger_new_room_effects();
|
|
*GHIDRA_CAST<undefined2 *>(&g_manager->_isNightmarePending) = 0x101;
|
|
Manager::Update(0);
|
|
this->_frameCount = 0;
|
|
this->_timeCounter = 0;
|
|
(this->_fadeOutColor)._alpha = 0.0;
|
|
this->_fadeOutTarget = 4;
|
|
GenericPrompt::Disappear(&(this->_genericPrompt)._sprite);
|
|
if ((this->_genericPrompt)._sprite._animState._animData != (void *)0x0) {
|
|
(this->_genericPrompt)._sprite._animState._isPlaying = 0;
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_genericPrompt))) + 0x12c)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_genericPrompt))) + 0x128)))) = 0;
|
|
KStack_28._unk = 0;
|
|
KStack_28._red = 0.0;
|
|
KStack_28._green = 0.0;
|
|
KStack_28._blue = 0.0;
|
|
KStack_28._alpha = 1.0;
|
|
Fadein(this,0.04,1,&KStack_28);
|
|
this->_framesSinceRoomTransition = 0;
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 006f8120
|
|
byte Game::IsGreedMode()
|
|
{
|
|
if ((this->_difficulty == 2) || (this->_difficulty == 3)) {
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 006f8140
|
|
void Game::restore_game_state(GameState *state, byte isContinue)
|
|
{
|
|
void **ppvVar1;
|
|
PlayerManager *pPVar2;
|
|
int iVar3;
|
|
byte isConsoleUsed;
|
|
Seeds *other;
|
|
size_t _Size;
|
|
byte *extraout_EAX;
|
|
byte *pbVar4;
|
|
uint bitsLow;
|
|
int unusedArg;
|
|
int *dstIcon;
|
|
uint wordIndex;
|
|
int *srcIcon;
|
|
uint bitsHigh;
|
|
void *slotState;
|
|
int iVar5;
|
|
void *pvVar6;
|
|
int waveIndex;
|
|
uint bitIndex;
|
|
void *destData;
|
|
Seeds seedsCopy;
|
|
void *redirectedPath [4];
|
|
uint redirectedPathSize;
|
|
uint redirectedPathCapacity;
|
|
std_string tmpString;
|
|
uint local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
uint local_8;
|
|
Manager *manager;
|
|
undefined4 *oldModeHandler;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00afc0a8;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_UINT(&(&tmpString)[1]._size);
|
|
ExceptionList = &local_10;
|
|
(GHIDRA_CAST<Seeds *>((&seedsCopy)))->Seeds::construct_from_copy(GHIDRA_CAST<Seeds *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x1e724)))));
|
|
local_8 = 0;
|
|
(GHIDRA_CAST<Seeds *>((&this->_seedEffects)))->Seeds::operator_assign(other);
|
|
local_8 = 0xffffffff;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<std::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(&seedsCopy._seedEffects,
|
|
(fuzzer_allocator<std::_Tree_node<unsigned_int,void*>_> *)&seedsCopy._seedEffects,
|
|
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(seedsCopy._seedEffects) + 4));
|
|
operator_delete(seedsCopy._seedEffects,0x14);
|
|
this->_challenge = *GHIDRA_CAST<int *>(state);
|
|
if (((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x5))) == '\0') && (g_manager->_isConsoleEnabled == 0)) {
|
|
isConsoleUsed = 0;
|
|
}
|
|
else {
|
|
isConsoleUsed = 1;
|
|
}
|
|
this->_isConsoleUsedThisRun = isConsoleUsed;
|
|
this->_difficulty = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x8))));
|
|
bitIndex = 0;
|
|
if (*GHIDRA_CAST<short *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0xc)))) != 0) {
|
|
do {
|
|
wordIndex = (bitIndex & 0xffff) >> 6;
|
|
bitsLow = 1 << (bitIndex & 0x1f);
|
|
bitsHigh = 0;
|
|
if (0x1f < (bitIndex & 0x3f)) {
|
|
bitsHigh = bitsLow;
|
|
}
|
|
bitsLow = bitsLow ^ bitsHigh;
|
|
if (0x3f < (bitIndex & 0x3f)) {
|
|
bitsHigh = bitsLow;
|
|
}
|
|
if ((&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0xe))))[bitIndex & 0xffff] == '\0') {
|
|
bitsLow = ~bitsLow & *GHIDRA_CAST<uint *>((this->_giantBookClickerImage + wordIndex * 8 + 0x28));
|
|
bitsHigh = *GHIDRA_CAST<uint *>((this->_giantBookClickerImage + wordIndex * 8 + 0x2c)) & ~bitsHigh;
|
|
}
|
|
else {
|
|
bitsLow = *GHIDRA_CAST<uint *>((this->_giantBookClickerImage + wordIndex * 8 + 0x28)) | bitsLow;
|
|
bitsHigh = *GHIDRA_CAST<uint *>((this->_giantBookClickerImage + wordIndex * 8 + 0x2c)) | bitsHigh;
|
|
}
|
|
*GHIDRA_CAST<uint *>((this->_giantBookClickerImage + wordIndex * 8 + 0x2c)) = bitsHigh;
|
|
*GHIDRA_CAST<uint *>((this->_giantBookClickerImage + wordIndex * 8 + 0x28)) = bitsLow;
|
|
bitIndex = bitIndex + 1;
|
|
} while ((ushort)bitIndex < *GHIDRA_CAST<ushort *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0xc)))));
|
|
}
|
|
this->_lastDevilRoomStage = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x44))));
|
|
pbVar4 = this->_encounteredBosses;
|
|
this->_treasureRoomsVisited = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x48))));
|
|
this->_planetariumsVisited = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x4c))));
|
|
this->_stagesWithoutHeartsPicked = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x50))));
|
|
this->_stagesWithoutDamage = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x54))));
|
|
this->_devilRoomDeals = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x58))));
|
|
this->_shopVisits = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x5c))));
|
|
this->_donationModGreed = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x60))));
|
|
this->_donationModAngel = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x64))));
|
|
this->_reviveMachineCoinsLeft = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x68))));
|
|
this->_reviveMachineUses = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x6c))));
|
|
this->_bossRushParTime = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x70))));
|
|
this->_blueWombParTime = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x74))));
|
|
this->_frameCount = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x78))));
|
|
this->_timeCounter = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x7c))));
|
|
this->_stageNameNumeral = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x80))));
|
|
this->_victoryLap = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0xdc))));
|
|
this->_lastLevelWithoutHalfHp = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0xe0))));
|
|
this->_isRerun = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x4)));
|
|
this->_lastLevelWithDamage = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x1e788))));
|
|
if (pbVar4 != &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x1e79c)))) {
|
|
pvVar6 = *(void **)&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x1e79c)));
|
|
_Size = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x1e7a0)))) - GHIDRA_INT(pvVar6);
|
|
destData = *(void **)pbVar4;
|
|
if (GHIDRA_UINT((*GHIDRA_CAST<int *>((this->_encounteredBosses + 8)) - GHIDRA_INT(destData) >> 3)) <
|
|
GHIDRA_UINT((GHIDRA_INT(_Size) >> 3))) {
|
|
std::vector<8byte>::_Clear_and_reserve(GHIDRA_INT(_Size) >> 3);
|
|
destData = *(void **)pbVar4;
|
|
}
|
|
memmove(destData,pvVar6,_Size);
|
|
*GHIDRA_CAST<size_t *>((this->_encounteredBosses + 4)) = _Size + GHIDRA_INT(destData);
|
|
}
|
|
this->_magicSkinUses = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x1e78c))));
|
|
std::vector<12byte>::operator_assign(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x1e790))));
|
|
this->_pixelationTimer = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x1e7a8))));
|
|
this->_pixelationDuration = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x1e7ac))));
|
|
if (isContinue != 0) {
|
|
init_procedural_item_surfaces(&this->_proceduralItemManager);
|
|
iVar5 = -2;
|
|
if (g_manager->_networkPlay == 0) {
|
|
iVar5 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x19d7c))));
|
|
}
|
|
if ((this->_seedEffects)._gameStartSeed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Error: Game Start Seed was not set.\n"));
|
|
}
|
|
PlayerManager::init_main_player
|
|
(&this->_playerManager,iVar5,(this->_seedEffects)._playerInitSeed);
|
|
builtin_strncpy(tmpString._buf + 8,"s.xml",6);
|
|
tmpString._capacity = 0xf;
|
|
tmpString._size = 0xd;
|
|
builtin_strncpy(tmpString._buf,"itempool",8);
|
|
local_8 = 1;
|
|
(GHIDRA_CAST<ModManager *>((&g_manager->_modManager)))->ModManager::TryRedirectPath(GHIDRA_CAST<std_string *>(redirectedPath),&tmpString);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 2;
|
|
pbVar4 = extraout_EAX;
|
|
if (0xf < *GHIDRA_CAST<uint *>((extraout_EAX + 0x14))) {
|
|
pbVar4 = *GHIDRA_CAST<byte **>(extraout_EAX);
|
|
}
|
|
(GHIDRA_CAST<ItemPool *>((&this->_itemPool)))->ItemPool::Init(*GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x1e5bc)))),pbVar4);
|
|
local_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),1);
|
|
if (0xf < redirectedPathCapacity) {
|
|
bitsLow = redirectedPathCapacity + 1;
|
|
pvVar6 = redirectedPath[0];
|
|
if (0xfff < bitsLow) {
|
|
pvVar6 = *(void **)(GHIDRA_INT(redirectedPath[0]) + -4);
|
|
bitsLow = redirectedPathCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(redirectedPath[0]) + (-4 - GHIDRA_INT(pvVar6))))) goto LAB_006f8543;
|
|
}
|
|
operator_delete(pvVar6,bitsLow);
|
|
}
|
|
local_8 = 0xffffffff;
|
|
redirectedPathSize = 0;
|
|
redirectedPathCapacity = 0xf;
|
|
redirectedPath[0] = (void *)(GHIDRA_UINT(redirectedPath[0]) & 0xffffff00);
|
|
if (0xf < tmpString._capacity) {
|
|
bitsLow = tmpString._capacity + 1;
|
|
pvVar6 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)tmpString._buf)) + 0x0)));
|
|
if (0xfff < bitsLow) {
|
|
pvVar6 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + -4);
|
|
bitsLow = tmpString._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar6))))) {
|
|
LAB_006f8543:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar6,bitsLow);
|
|
}
|
|
bitsLow = (this->_seedEffects)._gameStartSeed;
|
|
if (bitsLow == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Error: Game Start Seed was not set.\n"));
|
|
bitsLow = (this->_seedEffects)._gameStartSeed;
|
|
}
|
|
(GHIDRA_CAST<BossPool *>((&this->_bossPool)))->BossPool::init(bitsLow);
|
|
(this->_fortuneRNG)._seed = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x1e784))));
|
|
(this->_fortuneRNG)._shift1 = 5;
|
|
(this->_fortuneRNG)._shift2 = 9;
|
|
(this->_fortuneRNG)._shift3 = 7;
|
|
bitsLow = (this->_seedEffects)._gameStartSeed;
|
|
if (bitsLow == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Error: Game Start Seed was not set.\n"));
|
|
bitsLow = (this->_seedEffects)._gameStartSeed;
|
|
}
|
|
if (bitsLow == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Error: Game Start Seed was not set.\n"));
|
|
bitsLow = (this->_seedEffects)._gameStartSeed;
|
|
}
|
|
Seeds::Seed2String(&tmpString,bitsLow);
|
|
local_8 = 3;
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("RNG Start Seed: %s (%u) [Continue, %d]\n"));
|
|
local_8 = 0xffffffff;
|
|
if (0xf < tmpString._capacity) {
|
|
bitsLow = tmpString._capacity + 1;
|
|
pvVar6 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)tmpString._buf)) + 0x0)));
|
|
if (0xfff < bitsLow) {
|
|
pvVar6 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + -4);
|
|
bitsLow = tmpString._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar6))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar6,bitsLow);
|
|
}
|
|
manager = g_manager;
|
|
tmpString._size = 0;
|
|
tmpString._capacity = 0xf;
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) = (*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) & 0xffffffffffffff00;
|
|
if (g_manager->_networkPlay == 0) {
|
|
if (((((this->_seedEffects)._isCustomRun == 0) &&
|
|
(isConsoleUsed = (GHIDRA_CAST<Seeds *>((&this->_seedEffects)))->Seeds::AchievementUnlocksDisallowed(),
|
|
isConsoleUsed == 0)) &&
|
|
(isConsoleUsed = Manager::IsGameplayInputActive(unusedArg), isConsoleUsed == 0)) &&
|
|
((this->_isRerun == 0 && (this->_victoryLap < 1)))) {
|
|
isConsoleUsed = 0;
|
|
}
|
|
else {
|
|
isConsoleUsed = 1;
|
|
}
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("Setting PersistentGameData ReadOnly to %s\n"));
|
|
(manager->_persistentGameData)._isReadOnly = isConsoleUsed;
|
|
}
|
|
}
|
|
pPVar2 = &this->_playerManager;
|
|
(this->_playerManager)._rng._seed = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x1e780))));
|
|
(this->_playerManager)._rng._shift1 = 5;
|
|
(this->_playerManager)._rng._shift2 = 7;
|
|
(this->_playerManager)._rng._shift3 = 0x16;
|
|
(this->_fortuneRNG)._seed = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x1e784))));
|
|
(this->_fortuneRNG)._shift1 = 5;
|
|
(this->_fortuneRNG)._shift2 = 9;
|
|
(this->_fortuneRNG)._shift3 = 7;
|
|
(GHIDRA_CAST<ItemPool *>((&this->_itemPool)))->ItemPool::RestoreGameState(GHIDRA_CAST<GameStateItemPool *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x1e3cc)))));
|
|
FUN_00422ea0(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x1e680))));
|
|
FUN_009e0340(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x1fd98))));
|
|
pvVar6 = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x6778c)));
|
|
this->_ascentTimer = GHIDRA_UINT(((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x1e7b0))) != '\0'));
|
|
slotState = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x1e7b4)));
|
|
iVar5 = 7;
|
|
do {
|
|
(GHIDRA_CAST<Game_StateSlot *>((pvVar6)))->Game_StateSlot::operator_assign(slotState);
|
|
slotState = (void *)(GHIDRA_INT(slotState) + 800);
|
|
pvVar6 = (void *)(GHIDRA_INT(pvVar6) + 800);
|
|
iVar5 = iVar5 + -1;
|
|
} while (iVar5 != 0);
|
|
this->_deathCertificateExitTimer = GHIDRA_INT(*GHIDRA_CAST<short *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x1fd94)))));
|
|
oldModeHandler = (this->_deathmatchManager)._type;
|
|
*GHIDRA_CAST<undefined4 *>(&this->_deathmatchManager) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_deathmatchManager))) + 0x4)))) = 0;
|
|
if (oldModeHandler != GHIDRA_CAST<undefined4 *>(0x0)) {
|
|
(**(code **)*oldModeHandler)(1);
|
|
(this->_deathmatchManager)._type = (void *)0x0;
|
|
}
|
|
(GHIDRA_CAST<DeathmatchManager *>((&this->_deathmatchManager)))->DeathmatchManager::set_type((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((GHIDRA_UINT((byte)state))) + 0x1fddc))));
|
|
(**(code **)(*GHIDRA_CAST<int *>((this->_deathmatchManager)._type) + 0x74))(state);
|
|
(GHIDRA_CAST<PlayerManager *>((&this->_playerManager)))->PlayerManager::RestoreGameState(state);
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(this))))->Level::RestoreGameState(state);
|
|
(GHIDRA_CAST<PlayerManager *>((&this->_playerManager)))->PlayerManager::RestoreGameState_PostLevelInit(state);
|
|
srcIcon = GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x164))));
|
|
dstIcon = (g_manager->_nightmareScene)._stageBarIcons;
|
|
iVar5 = 0xe;
|
|
do {
|
|
iVar3 = *srcIcon;
|
|
srcIcon = srcIcon + 1;
|
|
*dstIcon = iVar3;
|
|
dstIcon = dstIcon + 1;
|
|
iVar5 = iVar5 + -1;
|
|
} while (iVar5 != 0);
|
|
isConsoleUsed = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x84)));
|
|
(this->_ambush)._isActive = isConsoleUsed;
|
|
(this->_ambush)._currentWave = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x88))));
|
|
if (isConsoleUsed != 0) {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 8)) == 0x11) {
|
|
(GHIDRA_CAST<Ambush *>((&this->_ambush)))->Ambush::shuffle_waves();
|
|
waveIndex = 0;
|
|
if (0 < ((this->_ambush)._currentWave + -1) * *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_ambush))) + 0x1c))))) {
|
|
do {
|
|
if ((this->_ambush)._bossRushWaves._begin == (this->_ambush)._bossRushWaves._end) break;
|
|
std::vector<12byte>::_Tidy();
|
|
ppvVar1 = &(this->_ambush)._bossRushWaves._end;
|
|
*ppvVar1 = (void *)(GHIDRA_INT(*ppvVar1) + -0xc);
|
|
waveIndex = waveIndex + 1;
|
|
} while (waveIndex <
|
|
((this->_ambush)._currentWave + -1) * *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_ambush))) + 0x1c)))));
|
|
}
|
|
}
|
|
else {
|
|
(this->_ambush)._isActive = 0;
|
|
(GHIDRA_CAST<Ambush *>((&this->_ambush)))->Ambush::StartChallenge();
|
|
(this->_ambush)._currentWave = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x88))));
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x265f0)))) = 0x1e;
|
|
iVar5 = (g_manager->_musicManager)._currentMusicID;
|
|
if ((iVar5 == 0x5f) || (iVar5 == 0x40)) {
|
|
iVar5 = (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 8)) == 0x11) + 0x26;
|
|
if (iVar5 < (GHIDRA_INT((g_manager->_musicManager)._entries._end) -
|
|
GHIDRA_INT((g_manager->_musicManager)._entries._begin)) / 0x60) {
|
|
(g_manager->_musicManager)._queuedMusicID = iVar5;
|
|
}
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Music *>((GHIDRA_CAST<Music *>(&g_manager->_musicManager))))->Music::Play((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 8)) == 0x11) + 0x26,
|
|
(g_manager->_optionsConfig)._musicVolume);
|
|
}
|
|
}
|
|
(GHIDRA_CAST<ScoreSheet *>((&this->_scoreSheet)))->ScoreSheet::restore_state(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x8c))));
|
|
bitsLow = 0;
|
|
pvVar6 = (this->_playerManager)._playerList._end;
|
|
oldModeHandler = (pPVar2->_playerList)._begin;
|
|
if (GHIDRA_INT(pvVar6) - GHIDRA_INT(oldModeHandler) >> 2 != 0) {
|
|
do {
|
|
if (GHIDRA_INT(pvVar6) - GHIDRA_INT(oldModeHandler) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
pvVar6 = (this->_playerManager)._playerList._end;
|
|
oldModeHandler = (pPVar2->_playerList)._begin;
|
|
}
|
|
if (bitsLow < GHIDRA_UINT((GHIDRA_INT(pvVar6) - GHIDRA_INT(oldModeHandler) >> 2))) {
|
|
oldModeHandler = oldModeHandler + bitsLow;
|
|
}
|
|
(GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(*oldModeHandler))))->Entity_Player::update_mini_mush_costume();
|
|
pvVar6 = (this->_playerManager)._playerList._end;
|
|
bitsLow = bitsLow + 1;
|
|
oldModeHandler = (pPVar2->_playerList)._begin;
|
|
} while (bitsLow < GHIDRA_UINT((GHIDRA_INT(pvVar6) - GHIDRA_INT(oldModeHandler) >> 2)));
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 006f9000
|
|
void Game::store_game_state(GameState *state)
|
|
{
|
|
undefined1 uVar1;
|
|
Seeds *other;
|
|
uint bitIndex;
|
|
uint wordIndex;
|
|
int iVar2;
|
|
uint highMask;
|
|
int *dstIcon;
|
|
uint lowMask;
|
|
int *srcIcon;
|
|
uint i;
|
|
size_t bossesBytes;
|
|
void *pvVar3;
|
|
int iVar4;
|
|
void *stateSlot;
|
|
void *dstBosses;
|
|
Seeds seedsCopy;
|
|
uint securityCookie;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
int local_8;
|
|
Game *temp_3fd7f2ceed;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00afc0ed;
|
|
local_10 = ExceptionList;
|
|
securityCookie = __security_cookie ^ GHIDRA_UINT(&(&seedsCopy)[1]._rng._shift3);
|
|
ExceptionList = &local_10;
|
|
(GHIDRA_CAST<GameState *>((state)))->GameState::Clear();
|
|
(GHIDRA_CAST<Seeds *>((&seedsCopy)))->Seeds::construct_from_copy(&this->_seedEffects);
|
|
local_8 = 0;
|
|
(GHIDRA_CAST<Seeds *>((GHIDRA_CAST<Seeds *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x1e724)))))))->Seeds::operator_assign(other);
|
|
local_8 = 0xffffffff;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<std::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(&seedsCopy._seedEffects,
|
|
(fuzzer_allocator<std::_Tree_node<unsigned_int,void*>_> *)&seedsCopy._seedEffects,
|
|
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(seedsCopy._seedEffects) + 4));
|
|
operator_delete(seedsCopy._seedEffects,0x14);
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x1e780)))) = (this->_playerManager)._rng._seed;
|
|
i = 0;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x1e784)))) = (this->_fortuneRNG)._seed;
|
|
*GHIDRA_CAST<int *>(state) = this->_challenge;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x4))) = this->_isRerun;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x5))) = this->_isConsoleUsedThisRun;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x8)))) = this->_difficulty;
|
|
*GHIDRA_CAST<undefined2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0xc)))) = 0x35;
|
|
do {
|
|
bitIndex = i & 0xffff;
|
|
lowMask = 1 << (i & 0x1f);
|
|
highMask = 0;
|
|
if (0x1f < (i & 0x3f)) {
|
|
highMask = lowMask;
|
|
}
|
|
lowMask = lowMask ^ highMask;
|
|
if (0x3f < (i & 0x3f)) {
|
|
highMask = lowMask;
|
|
}
|
|
wordIndex = bitIndex >> 6;
|
|
i = i + 1;
|
|
(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0xe))))[bitIndex] =
|
|
(lowMask & *GHIDRA_CAST<uint *>((this->_giantBookClickerImage + wordIndex * 8 + 0x28))) != 0 ||
|
|
(highMask & *GHIDRA_CAST<uint *>((this->_giantBookClickerImage + wordIndex * 8 + 0x2c))) != 0;
|
|
} while ((ushort)i < *GHIDRA_CAST<ushort *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0xc)))));
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x44)))) = this->_lastDevilRoomStage;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x48)))) = this->_treasureRoomsVisited;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x4c)))) = this->_planetariumsVisited;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x50)))) = this->_stagesWithoutHeartsPicked;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x54)))) = this->_stagesWithoutDamage;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x58)))) = this->_devilRoomDeals;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x5c)))) = this->_shopVisits;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x60)))) = this->_donationModGreed;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x64)))) = this->_donationModAngel;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x68)))) = this->_reviveMachineCoinsLeft;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x6c)))) = this->_reviveMachineUses;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x70)))) = this->_bossRushParTime;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x74)))) = this->_blueWombParTime;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x78)))) = this->_frameCount;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x7c)))) = this->_timeCounter;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x80)))) = this->_stageNameNumeral;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0xdc)))) = this->_victoryLap;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0xe0)))) = this->_lastLevelWithoutHalfHp;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x1e788)))) = this->_lastLevelWithDamage;
|
|
if (&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x1e79c))) != this->_encounteredBosses) {
|
|
pvVar3 = *(void **)this->_encounteredBosses;
|
|
bossesBytes = *GHIDRA_CAST<int *>((this->_encounteredBosses + 4)) - GHIDRA_INT(pvVar3);
|
|
dstBosses = *(void **)&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x1e79c)));
|
|
if (GHIDRA_UINT((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x1e7a4)))) - GHIDRA_INT(dstBosses) >> 3)) < GHIDRA_UINT((GHIDRA_INT(bossesBytes) >> 3)))
|
|
{
|
|
std::vector<8byte>::_Clear_and_reserve(GHIDRA_INT(bossesBytes) >> 3);
|
|
dstBosses = *(void **)&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x1e79c)));
|
|
}
|
|
memmove(dstBosses,pvVar3,bossesBytes);
|
|
*GHIDRA_CAST<size_t *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x1e7a0)))) = GHIDRA_INT(dstBosses) + bossesBytes;
|
|
}
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x1e7a8)))) = this->_pixelationTimer;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x1e7ac)))) = this->_pixelationDuration;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x1e78c)))) = this->_magicSkinUses;
|
|
std::vector<12byte>::operator_assign(&this->_erasedEntities);
|
|
(GHIDRA_CAST<ItemPool *>((&this->_itemPool)))->ItemPool::StoreGameState(GHIDRA_CAST<GameStateItemPool *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x1e3cc)))));
|
|
FUN_00422f80(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x1e680))));
|
|
std::vector<4byte>::resize
|
|
(GHIDRA_INT((this->_proceduralItemManager)._proceduralItems._end) -
|
|
GHIDRA_INT((this->_proceduralItemManager)._proceduralItems._begin) >> 2);
|
|
i = 0;
|
|
if (GHIDRA_INT((this->_proceduralItemManager)._proceduralItems._end) -
|
|
GHIDRA_INT((this->_proceduralItemManager)._proceduralItems._begin) >> 2 != 0) {
|
|
do {
|
|
*GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x1fd98)))) + i * 4)) =
|
|
*(undefined4 *)
|
|
(*GHIDRA_CAST<int *>((GHIDRA_INT((this->_proceduralItemManager)._proceduralItems._begin) + i * 4)) + 8);
|
|
i = i + 1;
|
|
} while (i < GHIDRA_UINT((GHIDRA_INT((this->_proceduralItemManager)._proceduralItems._end) -
|
|
GHIDRA_INT((this->_proceduralItemManager)._proceduralItems._begin) >> 2)));
|
|
}
|
|
(GHIDRA_CAST<Room *>((this->_room)))->Room::on_leave();
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(this))))->Level::store_game_state(state);
|
|
(GHIDRA_CAST<PlayerManager *>((&this->_playerManager)))->PlayerManager::store_game_state(state);
|
|
pvVar3 = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x1e7b4)));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x1e7b0))) = 0 < this->_ascentTimer;
|
|
stateSlot = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x6778c)));
|
|
iVar4 = 7;
|
|
do {
|
|
(GHIDRA_CAST<Game_StateSlot *>((pvVar3)))->Game_StateSlot::operator_assign(stateSlot);
|
|
stateSlot = (void *)(GHIDRA_INT(stateSlot) + 800);
|
|
pvVar3 = (void *)(GHIDRA_INT(pvVar3) + 800);
|
|
iVar4 = iVar4 + -1;
|
|
} while (iVar4 != 0);
|
|
iVar4 = 0xe;
|
|
srcIcon = (g_manager->_nightmareScene)._stageBarIcons;
|
|
*GHIDRA_CAST<short *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x1fd94)))) = (short)this->_deathCertificateExitTimer;
|
|
dstIcon = GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x164))));
|
|
do {
|
|
iVar2 = *srcIcon;
|
|
srcIcon = srcIcon + 1;
|
|
*dstIcon = iVar2;
|
|
temp_3fd7f2ceed = g_game;
|
|
dstIcon = dstIcon + 1;
|
|
iVar4 = iVar4 + -1;
|
|
} while (iVar4 != 0);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x84))) = (g_game->_ambush)._isActive;
|
|
iVar4 = (temp_3fd7f2ceed->_ambush)._currentWave;
|
|
iVar2 = iVar4 + -1;
|
|
if (iVar4 < 1) {
|
|
iVar2 = iVar4;
|
|
}
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x88)))) = iVar2;
|
|
(GHIDRA_CAST<ScoreSheet *>((&temp_3fd7f2ceed->_scoreSheet)))->ScoreSheet::store_state(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x8c))));
|
|
uVar1 = (**(code **)(*GHIDRA_CAST<int *>((this->_deathmatchManager)._type) + 4))();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((state)) + 0x1fddc))) = uVar1;
|
|
(**(code **)(*GHIDRA_CAST<int *>((this->_deathmatchManager)._type) + 0x70))(state);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 006f9770
|
|
void Game::End(int EndingID)
|
|
{
|
|
char isEndHandled;
|
|
byte isCleanup;
|
|
uint uVar1;
|
|
Manager *nextMenuState;
|
|
Manager *manager;
|
|
Game *game;
|
|
int *cutsceneCounter;
|
|
|
|
manager = g_manager;
|
|
game = g_game;
|
|
if (0xe < GHIDRA_UINT(EndingID)) {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("Invalid ending specified to (GHIDRA_CAST<Game *>(()))->Game::End()\n"));
|
|
return;
|
|
}
|
|
if ((1 < *GHIDRA_CAST<int *>(&this->_deathmatchManager)) && (*GHIDRA_CAST<int *>(&this->_deathmatchManager) != 6)) {
|
|
return;
|
|
}
|
|
if (EndingID == 1) {
|
|
DeleteSaveState();
|
|
LAB_006f97bc:
|
|
manager = g_manager;
|
|
game = g_game;
|
|
}
|
|
else {
|
|
if (g_manager->_netplayManager == *GHIDRA_CAST<NetplayManager *>((g_manager + 1))) goto LAB_006f97bc;
|
|
if ((((g_game->_dailyChallenge)._id == 0) && (g_game->_challenge == 0)) &&
|
|
(uVar1 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::count_main_players(), 1 < uVar1)) {
|
|
isEndHandled = FUN_00428d30(EndingID);
|
|
if (isEndHandled != '\0') {
|
|
return;
|
|
}
|
|
goto LAB_006f97bc;
|
|
}
|
|
if ((this->_onlineStatsScreen)._isActive == 0) {
|
|
online_stats_finalize(EndingID);
|
|
return;
|
|
}
|
|
}
|
|
if ((this->_dailyChallenge)._id != 0) {
|
|
if (manager->_netplayManager == *GHIDRA_CAST<NetplayManager *>((manager + 1))) {
|
|
FUN_006f9f20(EndingID);
|
|
FUN_00864fc0(EndingID == 1);
|
|
return;
|
|
}
|
|
online_stats_finalize(EndingID);
|
|
FUN_00864fc0(EndingID == 1);
|
|
return;
|
|
}
|
|
if ((manager->_netplayManager == *GHIDRA_CAST<NetplayManager *>((manager + 1))) ||
|
|
(manager[1]._persistentGameData._achievements[0] == 0)) {
|
|
isCleanup = 1;
|
|
}
|
|
else {
|
|
isCleanup = 0;
|
|
}
|
|
nextMenuState = GHIDRA_CAST<Manager *>(0x1);
|
|
if (manager->_netplayManager != *GHIDRA_CAST<NetplayManager *>((manager + 1))) {
|
|
nextMenuState = GHIDRA_CAST<Manager *>(&DAT_00000011);
|
|
}
|
|
switch(EndingID) {
|
|
case 1:
|
|
(GHIDRA_CAST<GameOver *>((&this->_gameOver)))->GameOver::Show();
|
|
persistent_game_data_set_writable();
|
|
FUN_00864fc0(EndingID == 1);
|
|
return;
|
|
case 2:
|
|
cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 3;
|
|
*cutsceneCounter = *cutsceneCounter + 1;
|
|
*GHIDRA_CAST<undefined1 *>(&manager->_persistentGameData) = 1;
|
|
cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 2;
|
|
*cutsceneCounter = *cutsceneCounter + 1;
|
|
*GHIDRA_CAST<undefined1 *>(&manager->_persistentGameData) = 1;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((manager->_cutsceneManager))) + 0x848))) = 1;
|
|
(manager->_cutsceneManager)._isQueuedCleanup = isCleanup;
|
|
manager->_cutsceneNextMenuState = GHIDRA_INT(nextMenuState);
|
|
(manager->_cutsceneManager)._queuedCutsceneId = 3;
|
|
break;
|
|
case 3:
|
|
switch((manager->_persistentGameData)._eventCounters[1]) {
|
|
case 1:
|
|
uVar1 = 4;
|
|
break;
|
|
case 2:
|
|
uVar1 = 5;
|
|
break;
|
|
case 3:
|
|
uVar1 = 6;
|
|
break;
|
|
case 4:
|
|
uVar1 = 7;
|
|
break;
|
|
case 5:
|
|
uVar1 = 8;
|
|
break;
|
|
case 6:
|
|
uVar1 = 9;
|
|
break;
|
|
case 7:
|
|
uVar1 = 10;
|
|
break;
|
|
case 8:
|
|
uVar1 = 0xb;
|
|
break;
|
|
case 9:
|
|
uVar1 = 0xc;
|
|
break;
|
|
case 10:
|
|
uVar1 = 0xd;
|
|
break;
|
|
case 0xb:
|
|
uVar1 = 0xe;
|
|
break;
|
|
default:
|
|
uVar1 = 2;
|
|
}
|
|
(GHIDRA_CAST<Manager *>((nextMenuState)))->Manager::ShowCutscene(uVar1,isCleanup,GHIDRA_UINT(nextMenuState));
|
|
manager = g_manager;
|
|
game = g_game;
|
|
goto LAB_006f995b;
|
|
case 4:
|
|
cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 0xf;
|
|
*cutsceneCounter = *cutsceneCounter + 1;
|
|
*GHIDRA_CAST<undefined1 *>(&manager->_persistentGameData) = 1;
|
|
cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 2;
|
|
*cutsceneCounter = *cutsceneCounter + 1;
|
|
*GHIDRA_CAST<undefined1 *>(&manager->_persistentGameData) = 1;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((manager->_cutsceneManager))) + 0x848))) = 1;
|
|
(manager->_cutsceneManager)._isQueuedCleanup = isCleanup;
|
|
manager->_cutsceneNextMenuState = GHIDRA_INT(nextMenuState);
|
|
(manager->_cutsceneManager)._queuedCutsceneId = 0xf;
|
|
break;
|
|
case 5:
|
|
cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 0x10;
|
|
*cutsceneCounter = *cutsceneCounter + 1;
|
|
*GHIDRA_CAST<undefined1 *>(&manager->_persistentGameData) = 1;
|
|
cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 2;
|
|
*cutsceneCounter = *cutsceneCounter + 1;
|
|
*GHIDRA_CAST<undefined1 *>(&manager->_persistentGameData) = 1;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((manager->_cutsceneManager))) + 0x848))) = 1;
|
|
(manager->_cutsceneManager)._isQueuedCleanup = isCleanup;
|
|
manager->_cutsceneNextMenuState = GHIDRA_INT(nextMenuState);
|
|
(manager->_cutsceneManager)._queuedCutsceneId = 0x10;
|
|
break;
|
|
case 6:
|
|
cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 0x12;
|
|
*cutsceneCounter = *cutsceneCounter + 1;
|
|
*GHIDRA_CAST<undefined1 *>(&manager->_persistentGameData) = 1;
|
|
cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 2;
|
|
*cutsceneCounter = *cutsceneCounter + 1;
|
|
*GHIDRA_CAST<undefined1 *>(&manager->_persistentGameData) = 1;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((manager->_cutsceneManager))) + 0x848))) = 1;
|
|
(manager->_cutsceneManager)._isQueuedCleanup = isCleanup;
|
|
manager->_cutsceneNextMenuState = GHIDRA_INT(nextMenuState);
|
|
(manager->_cutsceneManager)._queuedCutsceneId = 0x12;
|
|
break;
|
|
case 7:
|
|
cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 0x11;
|
|
*cutsceneCounter = *cutsceneCounter + 1;
|
|
*GHIDRA_CAST<undefined1 *>(&manager->_persistentGameData) = 1;
|
|
cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 2;
|
|
*cutsceneCounter = *cutsceneCounter + 1;
|
|
*GHIDRA_CAST<undefined1 *>(&manager->_persistentGameData) = 1;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((manager->_cutsceneManager))) + 0x848))) = 1;
|
|
(manager->_cutsceneManager)._isQueuedCleanup = isCleanup;
|
|
manager->_cutsceneNextMenuState = GHIDRA_INT(nextMenuState);
|
|
(manager->_cutsceneManager)._queuedCutsceneId = 0x11;
|
|
break;
|
|
case 8:
|
|
cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 0x13;
|
|
*cutsceneCounter = *cutsceneCounter + 1;
|
|
*GHIDRA_CAST<undefined1 *>(&manager->_persistentGameData) = 1;
|
|
cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 2;
|
|
*cutsceneCounter = *cutsceneCounter + 1;
|
|
*GHIDRA_CAST<undefined1 *>(&manager->_persistentGameData) = 1;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((manager->_cutsceneManager))) + 0x848))) = 1;
|
|
(manager->_cutsceneManager)._isQueuedCleanup = isCleanup;
|
|
manager->_cutsceneNextMenuState = GHIDRA_INT(nextMenuState);
|
|
(manager->_cutsceneManager)._queuedCutsceneId = 0x13;
|
|
break;
|
|
case 9:
|
|
cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 0x15;
|
|
*cutsceneCounter = *cutsceneCounter + 1;
|
|
*GHIDRA_CAST<undefined1 *>(&manager->_persistentGameData) = 1;
|
|
cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 2;
|
|
*cutsceneCounter = *cutsceneCounter + 1;
|
|
*GHIDRA_CAST<undefined1 *>(&manager->_persistentGameData) = 1;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((manager->_cutsceneManager))) + 0x848))) = 1;
|
|
(manager->_cutsceneManager)._isQueuedCleanup = isCleanup;
|
|
manager->_cutsceneNextMenuState = GHIDRA_INT(nextMenuState);
|
|
(manager->_cutsceneManager)._queuedCutsceneId = 0x15;
|
|
break;
|
|
case 10:
|
|
cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 0x14;
|
|
*cutsceneCounter = *cutsceneCounter + 1;
|
|
*GHIDRA_CAST<undefined1 *>(&manager->_persistentGameData) = 1;
|
|
cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 2;
|
|
*cutsceneCounter = *cutsceneCounter + 1;
|
|
*GHIDRA_CAST<undefined1 *>(&manager->_persistentGameData) = 1;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((manager->_cutsceneManager))) + 0x848))) = 1;
|
|
(manager->_cutsceneManager)._isQueuedCleanup = isCleanup;
|
|
manager->_cutsceneNextMenuState = GHIDRA_INT(nextMenuState);
|
|
(manager->_cutsceneManager)._queuedCutsceneId = 0x14;
|
|
break;
|
|
case 0xb:
|
|
cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 0x16;
|
|
*cutsceneCounter = *cutsceneCounter + 1;
|
|
*GHIDRA_CAST<undefined1 *>(&manager->_persistentGameData) = 1;
|
|
cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 2;
|
|
*cutsceneCounter = *cutsceneCounter + 1;
|
|
*GHIDRA_CAST<undefined1 *>(&manager->_persistentGameData) = 1;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((manager->_cutsceneManager))) + 0x848))) = 1;
|
|
(manager->_cutsceneManager)._isQueuedCleanup = isCleanup;
|
|
manager->_cutsceneNextMenuState = GHIDRA_INT(nextMenuState);
|
|
(manager->_cutsceneManager)._queuedCutsceneId = 0x16;
|
|
break;
|
|
case 0xc:
|
|
cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 0x17;
|
|
*cutsceneCounter = *cutsceneCounter + 1;
|
|
*GHIDRA_CAST<undefined1 *>(&manager->_persistentGameData) = 1;
|
|
cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 2;
|
|
*cutsceneCounter = *cutsceneCounter + 1;
|
|
*GHIDRA_CAST<undefined1 *>(&manager->_persistentGameData) = 1;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((manager->_cutsceneManager))) + 0x848))) = 1;
|
|
(manager->_cutsceneManager)._isQueuedCleanup = isCleanup;
|
|
manager->_cutsceneNextMenuState = GHIDRA_INT(nextMenuState);
|
|
(manager->_cutsceneManager)._queuedCutsceneId = 0x17;
|
|
break;
|
|
case 0xd:
|
|
cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 0x18;
|
|
*cutsceneCounter = *cutsceneCounter + 1;
|
|
*GHIDRA_CAST<undefined1 *>(&manager->_persistentGameData) = 1;
|
|
cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 2;
|
|
*cutsceneCounter = *cutsceneCounter + 1;
|
|
*GHIDRA_CAST<undefined1 *>(&manager->_persistentGameData) = 1;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((manager->_cutsceneManager))) + 0x848))) = 1;
|
|
(manager->_cutsceneManager)._isQueuedCleanup = isCleanup;
|
|
manager->_cutsceneNextMenuState = GHIDRA_INT(nextMenuState);
|
|
(manager->_cutsceneManager)._queuedCutsceneId = 0x18;
|
|
break;
|
|
case 0xe:
|
|
cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 0x1a;
|
|
*cutsceneCounter = *cutsceneCounter + 1;
|
|
*GHIDRA_CAST<undefined1 *>(&manager->_persistentGameData) = 1;
|
|
cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 2;
|
|
*cutsceneCounter = *cutsceneCounter + 1;
|
|
*GHIDRA_CAST<undefined1 *>(&manager->_persistentGameData) = 1;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((manager->_cutsceneManager))) + 0x848))) = 1;
|
|
(manager->_cutsceneManager)._isQueuedCleanup = isCleanup;
|
|
manager->_cutsceneNextMenuState = GHIDRA_INT(nextMenuState);
|
|
(manager->_cutsceneManager)._queuedCutsceneId = 0x1a;
|
|
break;
|
|
default:
|
|
if (EndingID == 1) {
|
|
persistent_game_data_set_writable();
|
|
goto LAB_006f9993;
|
|
}
|
|
goto LAB_006f995b;
|
|
}
|
|
(manager->_achievementOverlay)._isPopupBlocked = 1;
|
|
LAB_006f995b:
|
|
if ((this->_challenge == 0) &&
|
|
(((manager->_persistentGameData)._achievements[0x151] != 0 ||
|
|
(((manager->_state == 2 && (game != GHIDRA_CAST<Game *>(0x0))) &&
|
|
(((game->_dailyChallenge)._id != 0 || (game->_isDebug != 0)))))))) {
|
|
save_rerun_to_steam_cloud();
|
|
}
|
|
end_save_progress();
|
|
LAB_006f9993:
|
|
FUN_00864fc0(EndingID == 1);
|
|
return;
|
|
}
|
|
|
|
// 006fa0c0
|
|
void Game::Exit(byte ShouldSave)
|
|
{
|
|
Game *gameData;
|
|
Game *pGVar1;
|
|
int *piVar2;
|
|
int *piVar3;
|
|
int entryOffset;
|
|
int iVar4;
|
|
PersistentGameData *gameData;
|
|
void *statsEntry;
|
|
uint entryIndex;
|
|
uint *roomList;
|
|
undefined3 in_stack_00000005;
|
|
int *piStack_8;
|
|
char isNil;
|
|
Manager *manager;
|
|
void *playersEnd;
|
|
|
|
gameData = g_game;
|
|
if (g_game->_isStarted != 0) {
|
|
FUN_008650a0(_ShouldSave);
|
|
(GHIDRA_CAST<SFXManager *>((&g_manager->_sfxManager)))->SFXManager::StopLoopingSounds();
|
|
(GHIDRA_CAST<SFXManager *>((&g_manager->_sfxManager)))->SFXManager::Stop(0x256);
|
|
(GHIDRA_CAST<SFXManager *>((&g_manager->_sfxManager)))->SFXManager::Stop(599);
|
|
(GHIDRA_CAST<SFXManager *>((&g_manager->_sfxManager)))->SFXManager::Stop(600);
|
|
(GHIDRA_CAST<SFXManager *>((&g_manager->_sfxManager)))->SFXManager::Stop(0x259);
|
|
(GHIDRA_CAST<SFXManager *>((&g_manager->_sfxManager)))->SFXManager::Stop(0x3f0);
|
|
iVar4 = (gameData->_itemOverlay)._state;
|
|
if ((iVar4 != 0) && (iVar4 == 2)) {
|
|
(GHIDRA_CAST<ItemOverlay *>((&gameData->_itemOverlay)))->ItemOverlay::Update(1);
|
|
}
|
|
manager = g_manager;
|
|
iVar4 = (g_manager->_musicManager)._currentChannel;
|
|
(g_manager->_musicManager)._pitch = 1.0;
|
|
(manager->_musicManager)._targetPitch = 1.0;
|
|
(GHIDRA_CAST<Music *>((GHIDRA_CAST<Music *>(((manager->_musicManager)._channels + iVar4)))))->Music::SetPitchAll(1.0);
|
|
gameData = &g_manager->_persistentGameData;
|
|
if ((*GHIDRA_CAST<char *>(gameData) != '\0') && ((g_manager->_persistentGameData)._isFileLoaded != 0)) {
|
|
*GHIDRA_CAST<undefined1 *>(gameData) = 0;
|
|
(GHIDRA_CAST<Manager *>((GHIDRA_CAST<Manager *>(gameData))))->Manager::BackupSaveFile();
|
|
manager = g_manager;
|
|
piVar3 = GHIDRA_CAST<int *>(SteamInternal_ContextInit(&PTR_FUN_00c5c3a4));
|
|
if ((*piVar3 == 0) || ((manager->_optionsConfig)._enableSteamCloud == 0)) {
|
|
(GHIDRA_CAST<PersistentGameData *>((gameData)))->PersistentGameData::Save();
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<PersistentGameData *>((gameData)))->PersistentGameData::SaveToSteamCloud();
|
|
}
|
|
}
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((gameData)) + 0x2658b))) == '\0') {
|
|
if (ShouldSave == 0) {
|
|
DeleteSaveState();
|
|
}
|
|
else {
|
|
Manager::save_game_state();
|
|
}
|
|
}
|
|
gameData->_emoteMenuState = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((gameData)) + 0x2593c)))) = 0;
|
|
FUN_008d26c0(0,0);
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((gameData)) + 0x25948)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((gameData)) + 0x2590c)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&gameData->_gameOver) = 0;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((gameData->_gameOver))) + 0x8)))))))->ANM2::Reset();
|
|
(gameData->_leaderboard)._state = 0;
|
|
playersEnd = (gameData->_onlineStatsScreen)._players._end;
|
|
statsEntry = (gameData->_onlineStatsScreen)._players._begin;
|
|
if (statsEntry != playersEnd) {
|
|
do {
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>((GHIDRA_INT(statsEntry) + 8)))))->std::string::_Tidy_deallocate();
|
|
statsEntry = (void *)(GHIDRA_INT(statsEntry) + 0x38);
|
|
} while (statsEntry != playersEnd);
|
|
statsEntry = (gameData->_onlineStatsScreen)._players._begin;
|
|
}
|
|
(gameData->_onlineStatsScreen)._players._end = statsEntry;
|
|
(gameData->_onlineStatsScreen)._isActive = 0;
|
|
reset_run_state(gameData);
|
|
manager = g_manager;
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("Setting PersistentGameData ReadOnly to %s\n"));
|
|
pGVar1 = g_game;
|
|
(manager->_persistentGameData)._isReadOnly = 0;
|
|
(pGVar1->_playerManager)._stageTransitionPlayer = (void *)0x0;
|
|
*GHIDRA_CAST<undefined4 *>(&gameData->_stageTransition) = 0;
|
|
(gameData->_stageTransition)._frame = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((gameData)) + 0x1ba84))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((gameData)) + 0x1ba88)))) = 0;
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((gameData)) + 0x1ba90)))) = g_vectorZero.x;
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((gameData)) + 0x1ba94)))) = g_vectorZero.y;
|
|
(gameData->_stageTransition)._duration = 0x32;
|
|
(gameData->_roomTransition)._frame = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((gameData->_roomTransition))) + 0xc)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&gameData->_roomTransition) = 0;
|
|
(gameData->_roomTransition)._direction = 0;
|
|
(gameData->_roomTransition)._animation = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((gameData->_roomTransition))) + 0x20)))) = 0;
|
|
(gameData->_roomTransition)._flags = 0;
|
|
(pGVar1->_playerManager)._roomTransitionPlayer = (void *)0x0;
|
|
gameData->_gameStateFlags = 0;
|
|
(GHIDRA_CAST<ANM2 *>((&(gameData->_itemOverlay)._sprite)))->ANM2::Reset();
|
|
(GHIDRA_CAST<ANM2 *>((&(gameData->_itemOverlay)._megaMushPlayerSprite)))->ANM2::Reset();
|
|
(gameData->_itemOverlay)._state = 0;
|
|
(gameData->_itemOverlay)._overlayID = 0;
|
|
FUN_00421260();
|
|
_ShouldSave = GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((gameData->_roomConfig))) + 0x80))));
|
|
piStack_8 = GHIDRA_CAST<int *>(0x25);
|
|
do {
|
|
iVar4 = 2;
|
|
roomList = _ShouldSave;
|
|
do {
|
|
if (((char)roomList[3] != '\0') && (entryIndex = 0, *roomList != 0)) {
|
|
entryOffset = 0;
|
|
do {
|
|
entryIndex = entryIndex + 1;
|
|
*GHIDRA_CAST<undefined4 *>((entryOffset + 0x34 + roomList[-1])) =
|
|
*GHIDRA_CAST<undefined4 *>((entryOffset + 0x30 + roomList[-1]));
|
|
entryOffset = entryOffset + 0x5c;
|
|
} while (entryIndex < *roomList);
|
|
}
|
|
roomList = roomList + 0xb;
|
|
iVar4 = iVar4 + -1;
|
|
} while (iVar4 != 0);
|
|
_ShouldSave = _ShouldSave + 0x31;
|
|
piStack_8 = GHIDRA_CAST<int *>((GHIDRA_INT(piStack_8) + -1));
|
|
} while (piStack_8 != GHIDRA_CAST<int *>(0x0));
|
|
(GHIDRA_CAST<Console *>((&gameData->_console)))->Console::Close();
|
|
FUN_007384d0();
|
|
FUN_009b9150();
|
|
(GHIDRA_CAST<HUD *>((&gameData->_hud)))->HUD::unload_graphics();
|
|
FUN_009a19a0();
|
|
TextureCache::Purge();
|
|
piVar3 = GHIDRA_CAST<int *>(gameData->_preloadManager);
|
|
_ShouldSave = GHIDRA_CAST<uint *>(*piVar3);
|
|
if (_ShouldSave != GHIDRA_CAST<uint *>(piVar3)) {
|
|
do {
|
|
std::map<std::string>::find(&piStack_8,_ShouldSave + 4);
|
|
piVar2 = piStack_8;
|
|
if ((piStack_8 != piVar3) && ((char)piStack_8[10] != '\0')) {
|
|
iVar4 = piStack_8[0x11];
|
|
if (iVar4 != piStack_8[0x12]) {
|
|
do {
|
|
(GHIDRA_CAST<KAGE::SmartPointer *>(((void *)(iVar4 + 0x18))))->KAGE::SmartPointer::reset((void *)0x0);
|
|
iVar4 = iVar4 + 0x20;
|
|
} while (iVar4 != piVar2[0x12]);
|
|
}
|
|
*GHIDRA_CAST<undefined1 *>((piStack_8 + 10)) = 0;
|
|
}
|
|
TextureCache::Purge();
|
|
piVar3 = GHIDRA_CAST<int *>(_ShouldSave[2]);
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(piVar3) + 0xd)) == '\0') {
|
|
isNil = *GHIDRA_CAST<char *>((*piVar3 + 0xd));
|
|
_ShouldSave = GHIDRA_CAST<uint *>(piVar3);
|
|
piVar3 = GHIDRA_CAST<int *>(*piVar3);
|
|
while (isNil == '\0') {
|
|
isNil = *GHIDRA_CAST<char *>((*piVar3 + 0xd));
|
|
_ShouldSave = GHIDRA_CAST<uint *>(piVar3);
|
|
piVar3 = GHIDRA_CAST<int *>(*piVar3);
|
|
}
|
|
}
|
|
else {
|
|
isNil = *GHIDRA_CAST<char *>((GHIDRA_INT(_ShouldSave[1]) + 0xd));
|
|
piVar2 = GHIDRA_CAST<int *>(_ShouldSave[1]);
|
|
piVar3 = GHIDRA_CAST<int *>(_ShouldSave);
|
|
while ((_ShouldSave = GHIDRA_CAST<uint *>(piVar2), isNil == '\0' && (piVar3 == GHIDRA_CAST<int *>(_ShouldSave[2]))))
|
|
{
|
|
isNil = *GHIDRA_CAST<char *>((GHIDRA_INT(_ShouldSave[1]) + 0xd));
|
|
piVar2 = GHIDRA_CAST<int *>(_ShouldSave[1]);
|
|
piVar3 = GHIDRA_CAST<int *>(_ShouldSave);
|
|
}
|
|
}
|
|
piVar3 = GHIDRA_CAST<int *>(gameData->_preloadManager);
|
|
} while (_ShouldSave != GHIDRA_CAST<uint *>(piVar3));
|
|
}
|
|
FUN_009b5cb0();
|
|
gameData->_framesSinceRoomTransition = 0;
|
|
*GHIDRA_CAST<undefined2 *>(&gameData->_isStarted) = 0;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 006fadc0
|
|
void Game::Update()
|
|
{
|
|
void *pvVar1;
|
|
ulonglong uVar2;
|
|
longlong lVar3;
|
|
longlong lVar4;
|
|
longlong lVar5;
|
|
char cVar6;
|
|
byte isSinglePlayer;
|
|
int iVar7;
|
|
Entity_Player *player;
|
|
int *piVar8;
|
|
float *extraout_ECX;
|
|
int lobbyMembersBytes;
|
|
Manager *manager;
|
|
PauseScreen *pPVar9;
|
|
GenericPrompt *genericPrompt;
|
|
uint uVar10;
|
|
PlayerManager *playerManager;
|
|
uint uVar11;
|
|
HUD *pHVar12;
|
|
DebugRenderer debugNode;
|
|
DebugRenderer nextDebugNode;
|
|
PauseScreen *pPVar13;
|
|
float fVar14;
|
|
float newDizzyIntensity;
|
|
ulonglong timeNs;
|
|
undefined1 seedsCopy [76];
|
|
int iStack_80;
|
|
KColor fadeColor;
|
|
undefined1 lobby [12];
|
|
HUD *local_34;
|
|
undefined **local_30;
|
|
PauseScreen *local_2c;
|
|
undefined4 local_28;
|
|
PauseScreen *local_24;
|
|
undefined4 local_20;
|
|
uint local_1c;
|
|
Game *savedThis;
|
|
byte local_11;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 uStack_8;
|
|
float dizzyChangeSpeed;
|
|
Game *game;
|
|
|
|
uStack_8 = 0xffffffff;
|
|
puStack_c = &LAB_00afc189;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
local_24 = GHIDRA_CAST<PauseScreen *>(0x0);
|
|
local_1c = 0;
|
|
savedThis = this;
|
|
isSinglePlayer = (GHIDRA_CAST<Console *>((&this->_console)))->Console::update_state();
|
|
if (isSinglePlayer != 0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
update_trapdoor_loop_sfx(this);
|
|
local_34 = &this->_hud;
|
|
(GHIDRA_CAST<HUD *>((local_34)))->HUD::Update();
|
|
update_cutscene_state_machine();
|
|
if (0 < this->_bloomTimer) {
|
|
this->_bloomTimer = this->_bloomTimer + -1;
|
|
}
|
|
if ((0 < this->_screenShakeTimer) &&
|
|
(iVar7 = this->_screenShakeTimer + -1, this->_screenShakeTimer = iVar7, iVar7 < 1)) {
|
|
(this->_screenShakeOffset).x = g_vectorZero.x;
|
|
(this->_screenShakeOffset).y = g_vectorZero.y;
|
|
}
|
|
if (0 < this->_hallucinationTimer) {
|
|
this->_hallucinationTimer = this->_hallucinationTimer + -1;
|
|
}
|
|
if ((((((this->_shouldLerpColorModState != 0) &&
|
|
(ColorModState::move_toward
|
|
(&this->_currentColorModifier,&(this->_targetColorModifier)._red,
|
|
&(this->_lerpColorModifier)._red),
|
|
*extraout_ECX == (this->_targetColorModifier)._red)) &&
|
|
(extraout_ECX[1] == (this->_targetColorModifier)._green)) &&
|
|
((extraout_ECX[2] == (this->_targetColorModifier)._blue &&
|
|
(extraout_ECX[3] == (this->_targetColorModifier)._amount)))) &&
|
|
(extraout_ECX[4] == (this->_targetColorModifier)._brightness)) &&
|
|
(extraout_ECX[5] == (this->_targetColorModifier)._contrast)) {
|
|
this->_shouldLerpColorModState = 0;
|
|
}
|
|
pHVar12 = &this->_hud;
|
|
fVar14 = this->_lightningIntensity;
|
|
if (0.0 < fVar14) {
|
|
if (fVar14 <= 0.05) {
|
|
this->_lightningIntensity = 0.0;
|
|
}
|
|
else {
|
|
this->_lightningIntensity = fVar14 * 0.75;
|
|
}
|
|
}
|
|
fVar14 = (this->_fadeOutColor)._alpha;
|
|
if (fVar14 <= 0.0) goto LAB_006fb3bd;
|
|
iVar7 = this->_fadeOutTarget;
|
|
if (iVar7 == 0) {
|
|
fVar14 = fVar14 - this->_fadeSpeed;
|
|
(this->_fadeOutColor)._alpha = fVar14;
|
|
if (fVar14 < 0.0) {
|
|
(this->_fadeOutColor)._alpha = 0.0;
|
|
}
|
|
goto LAB_006fb3b6;
|
|
}
|
|
fVar14 = this->_fadeSpeed + fVar14;
|
|
(this->_fadeOutColor)._alpha = fVar14;
|
|
if ((this->_hud)._hudRefreshType != 2) {
|
|
(this->_hud)._hudRefreshType = 1;
|
|
(this->_hud)._hudRefreshCountdown = 2;
|
|
}
|
|
if (fVar14 < 1.0) goto LAB_006fb3b6;
|
|
(this->_fadeOutColor)._alpha = 1.0;
|
|
switch(iVar7) {
|
|
case 1:
|
|
(GHIDRA_CAST<KColor *>((&fadeColor)))->KColor::SetFromARGB(0xff000000);
|
|
manager = g_manager;
|
|
g_manager->_pendingMenuState = 2;
|
|
goto LAB_006fb36f;
|
|
case 2:
|
|
LAB_006fafdc:
|
|
(GHIDRA_CAST<KColor *>((&fadeColor)))->KColor::SetFromARGB(0xff000000);
|
|
manager = g_manager;
|
|
g_manager->_pendingMenuState = 3;
|
|
goto LAB_006fb36f;
|
|
case 3:
|
|
(GHIDRA_CAST<KColor *>((&fadeColor)))->KColor::SetFromARGB(0xff000000);
|
|
manager = g_manager;
|
|
g_manager->_pendingMenuState = 0x13;
|
|
goto LAB_006fb36f;
|
|
case 4:
|
|
(GHIDRA_CAST<KColor *>((&fadeColor)))->KColor::SetFromARGB(0xff000000);
|
|
manager = g_manager;
|
|
g_manager->_pendingMenuState = 1;
|
|
goto LAB_006fb36f;
|
|
case 5:
|
|
player = GetPlayer(g_game,0);
|
|
if ((player->_playerType == 9) || (player = GetPlayer(g_game,0), player->_playerType == 0x1e)) {
|
|
if ((g_manager->_persistentGameData)._eventCounters[0x15] == 0) goto LAB_006fafdc;
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::IncreaseEventCounter(0x15,-1);
|
|
LAB_006fb0d4:
|
|
(GHIDRA_CAST<Seeds *>((GHIDRA_CAST<Seeds *>(seedsCopy))))->Seeds::construct_from_copy(&g_game->_seedEffects);
|
|
Manager::RestartGame();
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Seeds *>((GHIDRA_CAST<Seeds *>(seedsCopy))))->Seeds::construct_from_copy(&g_game->_seedEffects);
|
|
Manager::RestartGame();
|
|
}
|
|
break;
|
|
case 6:
|
|
manager = g_manager;
|
|
if (g_manager->_netplayManager == *GHIDRA_CAST<NetplayManager *>((g_manager + 1))) {
|
|
LAB_006fb16a:
|
|
local_11 = '\x01';
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Multiplayer *>((&DAT_00c79a50)))->Multiplayer::get_lobby(lobby);
|
|
uStack_8 = 0;
|
|
local_1c = 1;
|
|
piVar8 = GHIDRA_CAST<int *>(FUN_00a286f0());
|
|
uStack_8 = 1;
|
|
local_24 = GHIDRA_CAST<PauseScreen *>(0x3);
|
|
local_1c = 3;
|
|
cVar6 = (**(code **)(*piVar8 + 0x14))();
|
|
manager = g_manager;
|
|
if ((cVar6 != '\0') && (cVar6 = FUN_0090c400(), cVar6 != '\0')) goto LAB_006fb16a;
|
|
local_11 = '\0';
|
|
}
|
|
pPVar9 = local_24;
|
|
if ((GHIDRA_UINT(local_24) & 2) != 0) {
|
|
pPVar9 = GHIDRA_CAST<PauseScreen *>((GHIDRA_UINT(local_24) & 0xfffffffd));
|
|
local_30 = KAGE::System::UserProfileBase::vftable;
|
|
}
|
|
uStack_8 = 0xffffffff;
|
|
if ((GHIDRA_UINT(pPVar9) & 1) != 0) {
|
|
(GHIDRA_CAST<KAGE::Network::Multiplayer::ConstLobby *>((lobby)))->KAGE::Network::Multiplayer::ConstLobby::~ConstLobby();
|
|
manager = g_manager;
|
|
}
|
|
if (local_11 != '\0') {
|
|
player = (GHIDRA_CAST<PlayerManager *>((&this->_playerManager)))->PlayerManager::GetPlayer(0);
|
|
iVar7 = player->_playerType;
|
|
local_24 = GHIDRA_CAST<PauseScreen *>((g_manager->_persistentGameData)._eventCounters[0x15]);
|
|
PersistentGameData::IncreaseEventCounter
|
|
(&g_manager->_persistentGameData,0x16,
|
|
-(g_manager->_persistentGameData)._eventCounters[0x16]);
|
|
if (((iVar7 == 9) || (iVar7 == 0x1e)) && (local_24 != GHIDRA_CAST<PauseScreen *>(0x0))) {
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::IncreaseEventCounter(0x15,-1);
|
|
}
|
|
if (g_manager->_netplayManager != *GHIDRA_CAST<NetplayManager *>((g_manager + 1))) {
|
|
FUN_0090c560();
|
|
}
|
|
goto LAB_006fb0d4;
|
|
}
|
|
(GHIDRA_CAST<NetplayManager *>((&manager->_netplayManager)))->NetplayManager::process_pending_joins(0);
|
|
break;
|
|
case 7:
|
|
NextVictoryLap(this);
|
|
break;
|
|
case 8:
|
|
(GHIDRA_CAST<Multiplayer *>((&DAT_00c79a50)))->Multiplayer::get_lobby(lobby);
|
|
uStack_8 = 2;
|
|
local_1c = 4;
|
|
piVar8 = GHIDRA_CAST<int *>(FUN_00a286f0());
|
|
uStack_8 = 3;
|
|
local_1c = 0xc;
|
|
cVar6 = (**(code **)(*piVar8 + 0x14))();
|
|
if (cVar6 == '\0') {
|
|
LAB_006fb28b:
|
|
local_11 = '\0';
|
|
}
|
|
else {
|
|
cVar6 = FUN_0090c400();
|
|
local_11 = '\x01';
|
|
if (cVar6 == '\0') goto LAB_006fb28b;
|
|
}
|
|
local_30 = KAGE::System::UserProfileBase::vftable;
|
|
uStack_8 = 0xffffffff;
|
|
(GHIDRA_CAST<KAGE::Network::Multiplayer::ConstLobby *>((lobby)))->KAGE::Network::Multiplayer::ConstLobby::~ConstLobby();
|
|
manager = g_manager;
|
|
if (local_11 != '\0') {
|
|
local_1c = 0;
|
|
lobbyMembersBytes =
|
|
GHIDRA_INT((g_manager->_lobbyMembers)._end) - GHIDRA_INT((g_manager->_lobbyMembers)._begin);
|
|
iVar7 = lobbyMembersBytes >> 0x1f;
|
|
if (lobbyMembersBytes / 0x14 + iVar7 != iVar7) {
|
|
iVar7 = 0;
|
|
do {
|
|
pvVar1 = (manager->_lobbyMembers)._begin;
|
|
local_1c = local_1c + 1;
|
|
*GHIDRA_CAST<byte *>((iVar7 + 8 + GHIDRA_INT(pvVar1))) = *GHIDRA_CAST<byte *>((iVar7 + 8 + GHIDRA_INT(pvVar1))) | 1;
|
|
iVar7 = iVar7 + 0x14;
|
|
} while (local_1c <
|
|
GHIDRA_UINT(((GHIDRA_INT((manager->_lobbyMembers)._end) - GHIDRA_INT((manager->_lobbyMembers)._begin))
|
|
/ 0x14)));
|
|
this = savedThis;
|
|
}
|
|
FUN_0090c560();
|
|
(GHIDRA_CAST<NetplayManager *>((&g_manager->_netplayManager)))->NetplayManager::process_pending_joins(1);
|
|
}
|
|
break;
|
|
case 10:
|
|
(GHIDRA_CAST<DeathmatchManager *>((&this->_deathmatchManager)))->DeathmatchManager::enter_arena();
|
|
break;
|
|
case 0xb:
|
|
(GHIDRA_CAST<KColor *>((&fadeColor)))->KColor::SetFromARGB(0xff000000);
|
|
manager = g_manager;
|
|
g_manager->_pendingMenuState = 0x11;
|
|
LAB_006fb36f:
|
|
(manager->_pendingMenuFadeColor)._red = fadeColor._red;
|
|
(manager->_pendingMenuFadeColor)._green = fadeColor._green;
|
|
(manager->_pendingMenuFadeColor)._blue = fadeColor._blue;
|
|
(manager->_pendingMenuFadeColor)._alpha = fadeColor._alpha;
|
|
manager->_isMenuPending = 1;
|
|
(manager->_pendingMenuFadeColor)._unk = fadeColor._unk;
|
|
}
|
|
pHVar12 = &this->_hud;
|
|
(g_manager->_achievementOverlay)._isPopupBlocked = 0;
|
|
if ((this->_fadeOutTarget != 8) && (this->_fadeOutTarget != 9)) {
|
|
this->_fadeOutTarget = 0;
|
|
}
|
|
LAB_006fb3b6:
|
|
(GHIDRA_CAST<HUD *>((pHVar12)))->HUD::PostUpdate();
|
|
LAB_006fb3bd:
|
|
if (0 < this->_freezeFrames) {
|
|
this->_freezeFrames = this->_freezeFrames + -1;
|
|
(GHIDRA_CAST<HUD *>((pHVar12)))->HUD::PostUpdate();
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&this->_gameOver) != 0) {
|
|
if ((this->_gameOver)._isStopSoundsPending != 0) {
|
|
(GHIDRA_CAST<SFXManager *>((&g_manager->_sfxManager)))->SFXManager::StopLoopingSounds();
|
|
(this->_gameOver)._isStopSoundsPending = 0;
|
|
}
|
|
pvVar1 = g_onlineVoteMap;
|
|
if (g_manager->_netplayManager != *GHIDRA_CAST<NetplayManager *>((g_manager + 1))) {
|
|
pPVar9 = GHIDRA_CAST<PauseScreen *>(0x0);
|
|
local_24 = *GHIDRA_CAST<PauseScreen **>(g_onlineVoteMap);
|
|
if (local_24 != g_onlineVoteMap) {
|
|
pPVar13 = GHIDRA_CAST<PauseScreen *>(0x0);
|
|
do {
|
|
pPVar9 = GHIDRA_CAST<PauseScreen *>((GHIDRA_INT(&pPVar13->_state) + 1));
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_24)) + 0x18)))) != 0) {
|
|
pPVar9 = pPVar13;
|
|
}
|
|
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>
|
|
*)&local_24);
|
|
pPVar13 = pPVar9;
|
|
} while (local_24 != pvVar1);
|
|
this = savedThis;
|
|
local_24 = pPVar9;
|
|
}
|
|
(g_manager->_popupButtons)._buttons[1]._isVisible = pPVar9 == GHIDRA_CAST<PauseScreen *>(0x0);
|
|
}
|
|
netplay_lobby_menu_update();
|
|
if (this->_revivePlayerMenu == 0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
this->_revivePlayerMenu = 2;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x24ed8)))) = 8;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x24ed0)))) = 0xffffffff;
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if ((this->_leaderboard)._state != 0) {
|
|
Leaderboard::Update();
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&this->_stageTransition) != 0) {
|
|
(GHIDRA_CAST<StageTransition *>((&this->_stageTransition)))->StageTransition::Update();
|
|
(GHIDRA_CAST<HUD *>((pHVar12)))->HUD::PostUpdate();
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&this->_roomTransition) != 0) {
|
|
(GHIDRA_CAST<RoomTransition *>((&this->_roomTransition)))->RoomTransition::Update();
|
|
update_map_input();
|
|
(GHIDRA_CAST<HUD *>((pHVar12)))->HUD::PostUpdate();
|
|
cVar6 = IsRoomTransitionActive();
|
|
if (cVar6 == '\0') {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
this->_framesSinceRoomTransition = 0;
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if ((this->_itemOverlay)._state == 0) {
|
|
isSinglePlayer = is_screen_transition_active(&this->_genericPrompt);
|
|
if (isSinglePlayer != 0) {
|
|
(GHIDRA_CAST<GenericPrompt *>((genericPrompt)))->GenericPrompt::Update(0);
|
|
if ((this->_genericPrompt)._isOnlineVote != 0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((this->_genericPrompt))) + 0x12c)))) == 1) {
|
|
(GHIDRA_CAST<KColor *>((&fadeColor)))->KColor::SetFromARGB(0xff000000);
|
|
fVar14 = (this->_fadeOutColor)._alpha;
|
|
this->_fadeSpeed = 0.08;
|
|
this->_fadeOutTarget = 7;
|
|
(this->_fadeOutColor)._red = fadeColor._red;
|
|
(this->_fadeOutColor)._green = fadeColor._green;
|
|
(this->_fadeOutColor)._blue = fadeColor._blue;
|
|
(this->_fadeOutColor)._alpha = fVar14;
|
|
(this->_fadeOutColor)._unk = 0;
|
|
(this->_fadeOutColor)._alpha = (this->_fadeOutColor)._alpha + 0.08;
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if ((this->_onlineStatsScreen)._isActive != 0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
}
|
|
else {
|
|
local_24 = &this->_pauseScreen;
|
|
if ((this->_pauseScreen)._state != 0) {
|
|
if (g_manager->_netplayManager == *GHIDRA_CAST<NetplayManager *>((g_manager + 1))) goto LAB_006fb6ae;
|
|
pHVar12 = &this->_hud;
|
|
}
|
|
(GHIDRA_CAST<ItemOverlay *>((&this->_itemOverlay)))->ItemOverlay::Update(0);
|
|
if ((this->_itemOverlay)._state == 2) {
|
|
(GHIDRA_CAST<HUD *>((pHVar12)))->HUD::PostUpdate();
|
|
if (local_24->_state == 0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
netplay_lobby_menu_update();
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
}
|
|
LAB_006fb6ae:
|
|
local_11 = this->_isInstantFadeIn;
|
|
manager = g_manager;
|
|
if (0.0 < (this->_fadeInColor)._alpha) {
|
|
if ((g_manager->_netplayManager == *GHIDRA_CAST<NetplayManager *>((g_manager + 1))) && (local_11 == 0)) {
|
|
timeNs = GetTimeNs();
|
|
uVar10 = GHIDRA_UINT((timeNs >> 0x20));
|
|
uVar2 = (timeNs & 0xffffffff) * 0xd7b634db;
|
|
local_30 = GHIDRA_CAST<undefined **>(uVar2);
|
|
lVar3 = (timeNs & 0xffffffff) * 0x431bde82;
|
|
local_28 = (undefined4)((ulonglong)lVar3 >> 0x20);
|
|
lVar4 = (ulonglong)uVar10 * 0xd7b634db;
|
|
local_1c = GHIDRA_UINT(((ulonglong)lVar4 >> 0x20));
|
|
lVar5 = (ulonglong)uVar10 * 0x431bde82;
|
|
local_24 = GHIDRA_CAST<PauseScreen *>(lVar5);
|
|
uVar2 = lVar4 + (uVar2 >> 0x20);
|
|
uVar11 = GHIDRA_UINT((uVar2 >> 0x20));
|
|
lVar3 = lVar3 + (uVar2 & 0xffffffff);
|
|
local_20 = (undefined4)lVar3;
|
|
uVar10 = GHIDRA_UINT(((ulonglong)lVar3 >> 0x20));
|
|
lVar5 = lVar5 + (ulonglong)CONCAT14(CARRY4(uVar11,uVar10),uVar11 + uVar10);
|
|
uVar10 = GHIDRA_UINT(((ulonglong)lVar5 >> 0x20));
|
|
uVar11 = GHIDRA_UINT(lVar5) >> 0x12 | uVar10 * 0x4000;
|
|
local_2c = (PauseScreen *)
|
|
(((uVar10 >> 0x12) - *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((g_manager)) + 0x4ae24))))) -
|
|
GHIDRA_UINT((uVar11 < *GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((g_manager)) + 0x4ae20)))))));
|
|
this = savedThis;
|
|
if ((local_2c == GHIDRA_CAST<PauseScreen *>(0x0)) &&
|
|
(manager = g_manager, uVar11 - *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((g_manager)) + 0x4ae20)))) < 0xbb9))
|
|
goto LAB_006fb811;
|
|
}
|
|
manager = g_manager;
|
|
fVar14 = (this->_fadeInColor)._alpha - this->_fadeSpeed;
|
|
(this->_fadeInColor)._alpha = fVar14;
|
|
(this->_hud)._hudRefreshType = 2;
|
|
(this->_hud)._hudRefreshCountdown = 2;
|
|
if ((fVar14 <= 0.0) || (local_11 != 0)) {
|
|
iVar7 = *GHIDRA_CAST<int *>(&this->_deathmatchManager);
|
|
this->_isInstantFadeIn = 0;
|
|
(this->_fadeInColor)._alpha = 0.0;
|
|
if (iVar7 < 2) {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(this))))->Level::ShowName(0);
|
|
entity_vector_set_flag_410(&this->_playerManager,1);
|
|
manager = g_manager;
|
|
}
|
|
(GHIDRA_CAST<KAGE::SmartPointer *>((&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((manager)) + 0x4ae0c))))))->KAGE::SmartPointer::reset((void *)0x0);
|
|
(GHIDRA_CAST<KAGE::SmartPointer *>((&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((manager)) + 0x4ae14))))))->KAGE::SmartPointer::reset((void *)0x0);
|
|
manager = g_manager;
|
|
}
|
|
}
|
|
LAB_006fb811:
|
|
if (0.0 < (this->_fadeInColor)._alpha) {
|
|
(GHIDRA_CAST<HUD *>((local_34)))->HUD::PostUpdate();
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if ((((manager->_isWindowFocused == 0) && ((manager->_optionsConfig)._enablePauseOnFocusLost != 0)
|
|
) && (manager->_netplayManager == *GHIDRA_CAST<NetplayManager *>((manager + 1)))) &&
|
|
((this->_pauseScreen)._state == 0)) {
|
|
(GHIDRA_CAST<PauseScreen *>((&this->_pauseScreen)))->PauseScreen::Show();
|
|
manager = g_manager;
|
|
}
|
|
local_2c = &this->_pauseScreen;
|
|
if ((this->_pauseScreen)._state != 0) {
|
|
netplay_lobby_menu_update();
|
|
pHVar12 = this->_room;
|
|
iVar7 = *GHIDRA_CAST<int *>((pHVar12->_playerHUD + 0x12f8));
|
|
local_34 = pHVar12;
|
|
std::map::destroy_subtree
|
|
(pHVar12->_playerHUD + 0x12f8,pHVar12->_playerHUD + 0x12f8,*(void **)(iVar7 + 4));
|
|
*GHIDRA_CAST<int *>((iVar7 + 4)) = iVar7;
|
|
*GHIDRA_CAST<int *>(iVar7) = iVar7;
|
|
*GHIDRA_CAST<int *>((iVar7 + 8)) = iVar7;
|
|
pHVar12->_playerHUD[0x12fc] = 0;
|
|
pHVar12->_playerHUD[0x12fd] = 0;
|
|
pHVar12->_playerHUD[0x12fe] = 0;
|
|
pHVar12->_playerHUD[0x12ff] = 0;
|
|
local_34->_playerHUD[0x12a4] = 0;
|
|
local_34->_playerHUD[0x12a5] = 0;
|
|
local_34->_playerHUD[0x12a6] = 0;
|
|
local_34->_playerHUD[0x12a7] = 0;
|
|
isSinglePlayer = is_single_player(local_2c);
|
|
if (isSinglePlayer != 0) {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
manager = g_manager;
|
|
this = savedThis;
|
|
}
|
|
if ((manager->_netplayManager == *GHIDRA_CAST<NetplayManager *>((manager + 1))) &&
|
|
(this->_revivePlayerMenu != 0)) {
|
|
coop_join_menu_update(&this->_revivePlayerMenu);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
this->_framesSinceRoomTransition = this->_framesSinceRoomTransition + 1;
|
|
update_map_input();
|
|
BossOverlay::update();
|
|
if (0 < this->_ascentTimer) {
|
|
iVar7 = this->_ascentTimer + 1;
|
|
this->_ascentTimer = iVar7;
|
|
this->_screenShakeTimer = iVar7 / 6 + 2;
|
|
if (0x59 < iVar7) {
|
|
this->_screenShakeTimer = 0;
|
|
this->_ascentTimer = 0;
|
|
(this->_screenShakeOffset).x = g_vectorZero.x;
|
|
(this->_screenShakeOffset).y = g_vectorZero.y;
|
|
StartStageTransition(this,0,5,GHIDRA_CAST<Entity_Player *>(0x0));
|
|
}
|
|
}
|
|
if (0 < this->_deathCertificateExitTimer) {
|
|
iVar7 = this->_deathCertificateExitTimer + -1;
|
|
this->_screenShakeTimer = 10;
|
|
this->_deathCertificateExitTimer = iVar7;
|
|
game = g_game;
|
|
if ((iVar7 < 1) && (this->_deathCertificateExitTimer = 0, game->_currentDimensionIdx == 2)) {
|
|
game->_leaveDoor = -1;
|
|
iStack_80 = 0x6fb9f7;
|
|
StartRoomTransition(game,*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((game)) + 0x18900)))),-1,0x14,GHIDRA_CAST<Entity_Player *>(0x0),
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((GHIDRA_INT((char)game))) + 0x18904))));
|
|
}
|
|
}
|
|
this->_timeCounter = this->_timeCounter + 1;
|
|
iVar7 = this->_frameCount + 1;
|
|
this->_frameCount = iVar7;
|
|
if ((iVar7 == (iVar7 / 0x1e) * 0x1e) && ((this->_hud)._hudRefreshType != 2)) {
|
|
(this->_hud)._hudRefreshType = 1;
|
|
(this->_hud)._hudRefreshCountdown = 2;
|
|
}
|
|
(GHIDRA_CAST<Room *>((this->_room)))->Room::Update();
|
|
(GHIDRA_CAST<PlayerManager *>((playerManager)))->PlayerManager::Update();
|
|
online_stats_register_players();
|
|
if (this->_darknessTimeout < 1) {
|
|
fVar14 = this->_darknessModifier - 0.033333335;
|
|
this->_darknessModifier = fVar14;
|
|
if (fVar14 < 0.0) {
|
|
this->_darknessModifier = 0.0;
|
|
}
|
|
}
|
|
else {
|
|
fVar14 = this->_darknessModifier + 0.04761905;
|
|
this->_darknessModifier = fVar14;
|
|
if (1.0 < fVar14) {
|
|
this->_darknessModifier = 1.0;
|
|
}
|
|
this->_darknessTimeout = this->_darknessTimeout + -1;
|
|
}
|
|
fVar14 = this->_dizzyIntensity;
|
|
newDizzyIntensity = this->_dizzyTargetIntensity;
|
|
if (fVar14 != newDizzyIntensity) {
|
|
dizzyChangeSpeed = this->_dizzyIntensityChangeSpeed;
|
|
if (dizzyChangeSpeed < ABS(fVar14 - newDizzyIntensity)) {
|
|
if (newDizzyIntensity <= fVar14) {
|
|
newDizzyIntensity = fVar14 - dizzyChangeSpeed;
|
|
}
|
|
else {
|
|
newDizzyIntensity = dizzyChangeSpeed + fVar14;
|
|
}
|
|
}
|
|
this->_dizzyIntensity = newDizzyIntensity;
|
|
}
|
|
if (0 < this->_pixelationTimer) {
|
|
this->_pixelationTimer = this->_pixelationTimer + -1;
|
|
}
|
|
(GHIDRA_CAST<HUD *>((&this->_hud)))->HUD::PostUpdate();
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x67730)))) != 0) &&
|
|
(debugNode = *GHIDRA_CAST<DebugRenderer *>(this->_debugRenderer), debugNode != this->_debugRenderer)) {
|
|
do {
|
|
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(debugNode) + 0xc));
|
|
if (iVar7 == 0) {
|
|
nextDebugNode = *GHIDRA_CAST<DebugRenderer *>(debugNode);
|
|
**GHIDRA_CAST<DebugRenderer **>((GHIDRA_CAST<char *>(debugNode) + 4)) = nextDebugNode;
|
|
*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(debugNode) + 4)) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(debugNode) + 4));
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((savedThis)) + 0x67730)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((savedThis)) + 0x67730)))) + -1;
|
|
std::vector<std::string>::_Tidy();
|
|
std::vector<Vector>::_Tidy();
|
|
FID_conflict__Tidy(GHIDRA_CAST<int *>((GHIDRA_INT(debugNode) + 0x1c)));
|
|
FUN_0042f240();
|
|
operator_delete((void *)debugNode,0x40);
|
|
this = savedThis;
|
|
}
|
|
else {
|
|
if (0 < iVar7) {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(debugNode) + 0xc)) = iVar7 + -1;
|
|
}
|
|
nextDebugNode = *GHIDRA_CAST<DebugRenderer *>(debugNode);
|
|
}
|
|
debugNode = nextDebugNode;
|
|
} while (nextDebugNode != this->_debugRenderer);
|
|
}
|
|
FUN_008607a0();
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 006fbc10
|
|
void Game::Render()
|
|
{
|
|
code *pcVar1;
|
|
Vector pos;
|
|
char cVar2;
|
|
byte bVar3;
|
|
undefined4 *puVar4;
|
|
uint uVar5;
|
|
int iVar6;
|
|
float *fadeAmountPtr;
|
|
float *pixelationAmountPtr;
|
|
undefined *shader;
|
|
ColorMod *color;
|
|
Entity_Player *debugPlayer;
|
|
KColor *color_00;
|
|
int unused;
|
|
int unused_00;
|
|
KColor *color_01;
|
|
KColor *color_02;
|
|
KColor *color_03;
|
|
KColor *color_04;
|
|
int unused_01;
|
|
KColor *color_05;
|
|
int unused_02;
|
|
KColor *color_06;
|
|
KColor *color_07;
|
|
int iVar7;
|
|
int unused_03;
|
|
int extraout_ECX;
|
|
KColor *color_08;
|
|
int unused_04;
|
|
int extraout_ECX_00;
|
|
FontSettings *settings;
|
|
float stageTransitionProgress;
|
|
float stageTransitionProgress;
|
|
float transitionProgress;
|
|
undefined1 *puVar9;
|
|
void *pvVar10;
|
|
undefined1 auStack_30a [2];
|
|
undefined1 bloomQuad [112];
|
|
undefined1 snapshotQuad [112];
|
|
undefined1 screenQuad [112];
|
|
undefined1 overlayQuad [116];
|
|
undefined4 pixelationParams;
|
|
undefined4 pixelationTopLeftY;
|
|
undefined4 pixelationTopRightX;
|
|
undefined4 pixelationTopRightY;
|
|
undefined4 pixelationBottomLeftX;
|
|
undefined4 pixelationBottomLeftY;
|
|
undefined4 pixelationBottomRightX;
|
|
undefined4 pixelationBottomRightY;
|
|
undefined1 local_11c;
|
|
undefined4 bloomParams;
|
|
undefined4 bloomTopLeftY;
|
|
undefined4 bloomTopRightX;
|
|
undefined4 bloomTopRightY;
|
|
undefined4 bloomBottomLeftX;
|
|
undefined4 bloomBottomLeftY;
|
|
undefined4 bloomBottomRightX;
|
|
undefined4 bloomBottomRightY;
|
|
undefined1 local_f8;
|
|
undefined4 shaderParams;
|
|
undefined4 shaderTopLeftY;
|
|
undefined4 shaderTopRightX;
|
|
undefined4 shaderTopRightY;
|
|
undefined4 shaderBottomLeftX;
|
|
undefined4 shaderBottomLeftY;
|
|
undefined4 shaderBottomRightX;
|
|
undefined4 shaderBottomRightY;
|
|
undefined1 local_d4;
|
|
float clickerQuadTopLeftX;
|
|
float clickerQuadTopLeftY;
|
|
float clickerQuadTopRightX;
|
|
float clickerQuadTopRightY;
|
|
KColor local_c0;
|
|
undefined4 quadParams;
|
|
undefined4 quadTopLeftY;
|
|
undefined4 local_a4;
|
|
undefined4 quadTopRightY;
|
|
undefined4 quadBottomLeftX;
|
|
undefined4 quadBottomLeftY;
|
|
undefined4 quadBottomRightX;
|
|
undefined4 quadBottomRightY;
|
|
undefined1 local_8c;
|
|
Game *local_88;
|
|
Vector local_84;
|
|
char isColorModifierActive;
|
|
char isRoomSnapshot;
|
|
undefined4 *local_78;
|
|
Color clickerColor;
|
|
KColor local_48;
|
|
float screenSize;
|
|
float screenSizeY;
|
|
Vector local_2c;
|
|
uint stackCookie;
|
|
undefined1 *puStack_20;
|
|
void *local_1c;
|
|
undefined1 *puStack_18;
|
|
undefined4 local_14;
|
|
Font *desyncFont;
|
|
Game *game;
|
|
bool isFlipX;
|
|
bool isFlipY;
|
|
Manager *manager;
|
|
char *room;
|
|
int transitionDuration;
|
|
|
|
puStack_20 = GHIDRA_CAST<undefined1 *>((GHIDRA_INT(register0x00000010) + -4));
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00afc1d6;
|
|
local_1c = ExceptionList;
|
|
stackCookie = __security_cookie ^ GHIDRA_INT(register0x00000010) - 0x10U;
|
|
ExceptionList = &local_1c;
|
|
local_88 = this;
|
|
puVar9 = GHIDRA_CAST<undefined1 *>((GHIDRA_INT(register0x00000010) + -4));
|
|
if (this->_triggerWindowResize != 0) {
|
|
recreate_render_targets();
|
|
this->_triggerWindowResize = 0;
|
|
puVar9 = puStack_20;
|
|
}
|
|
puStack_20 = puVar9;
|
|
(GHIDRA_CAST<Room *>((this->_room)))->Room::render_lighting();
|
|
if (*GHIDRA_CAST<int *>(&this->_deathmatchManager) == 4) {
|
|
(**(code **)(*GHIDRA_CAST<int *>((this->_deathmatchManager)._type) + 0x14))();
|
|
}
|
|
game = g_game;
|
|
local_78 = GHIDRA_CAST<undefined4 *>(&DAT_00000008);
|
|
std::set<int>::find_node();
|
|
if ((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(local_2c.y) + 0xd)) != '\0') ||
|
|
(pvVar10 = (void *)local_2c.y, 8 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_2c.y) + 0x10)))) {
|
|
pvVar10 = (game->_seedEffects)._seedEffects;
|
|
}
|
|
if (pvVar10 != (game->_seedEffects)._seedEffects) {
|
|
local_2c.x = 0.0;
|
|
local_2c.y = 0.0;
|
|
std::vector::resize(&local_2c);
|
|
puVar4 = std::deque::back();
|
|
if (GHIDRA_CAST<byte *>((puVar4 + 1)) != GHIDRA_CAST<byte *>(0x0)) {
|
|
*GHIDRA_CAST<byte *>((puVar4 + 1)) = (byte)(g_graphicsManager_flags >> 5) & 1;
|
|
}
|
|
*puVar4 = g_graphicsManager_renderTarget;
|
|
(GHIDRA_CAST<KAGE_Graphics *>((&DAT_00c798e0)))->KAGE_Graphics::SetRenderTarget(DAT_00c79794,1);
|
|
}
|
|
if (0 < this->_hallucinationTimer) {
|
|
local_2c.x = 0.0;
|
|
local_2c.y = 0.0;
|
|
std::vector::resize(&local_2c);
|
|
puVar4 = std::deque::back();
|
|
if (GHIDRA_CAST<byte *>((puVar4 + 1)) != GHIDRA_CAST<byte *>(0x0)) {
|
|
*GHIDRA_CAST<byte *>((puVar4 + 1)) = (byte)(g_graphicsManager_flags >> 5) & 1;
|
|
}
|
|
*puVar4 = g_graphicsManager_renderTarget;
|
|
(GHIDRA_CAST<KAGE_Graphics *>((&DAT_00c798e0)))->KAGE_Graphics::SetRenderTarget(DAT_00c7979c,1);
|
|
}
|
|
stageTransitionProgress = 0.0;
|
|
transitionProgress = 1.0;
|
|
if ((g_manager->_optionsConfig)._enablePixelation != 0) {
|
|
iVar6 = *GHIDRA_CAST<int *>(&this->_stageTransition);
|
|
if ((iVar6 == 3) || (iVar6 == 2)) {
|
|
iVar7 = (this->_stageTransition)._frame;
|
|
transitionDuration = (this->_stageTransition)._duration;
|
|
stageTransitionProgress =
|
|
(float)((double)iVar7 + __uint_to_double_fixup[-(iVar7 >> 0x1f)]) /
|
|
(float)((double)transitionDuration +
|
|
__uint_to_double_fixup[-(transitionDuration >> 0x1f)]);
|
|
if (iVar6 == 3) {
|
|
stageTransitionProgress = 1.0 - stageTransitionProgress;
|
|
}
|
|
if ((stageTransitionProgress < 0.0) || (cVar2 = FUN_009301d0(), cVar2 == '\0'))
|
|
goto LAB_006fbde8;
|
|
}
|
|
else {
|
|
LAB_006fbde8:
|
|
if (*GHIDRA_CAST<int *>(&this->_roomTransition) == 2) {
|
|
transitionProgress =
|
|
(float)(this->_roomTransition)._frame / (float)(this->_roomTransition)._duration;
|
|
}
|
|
else {
|
|
if (*GHIDRA_CAST<int *>(&this->_roomTransition) != 3) goto LAB_006fbe57;
|
|
transitionProgress =
|
|
transitionProgress -
|
|
(float)(this->_roomTransition)._frame / (float)(this->_roomTransition)._duration;
|
|
}
|
|
if ((transitionProgress < stageTransitionProgress) || ((this->_roomTransition)._animation != 2))
|
|
goto LAB_006fbe57;
|
|
}
|
|
FUN_00683680();
|
|
(GHIDRA_CAST<KAGE_Graphics *>((&DAT_00c798e0)))->KAGE_Graphics::SetRenderTarget(DAT_00c79758,1);
|
|
}
|
|
LAB_006fbe57:
|
|
if ((0 < this->_bloomTimer) && ((g_manager->_optionsConfig)._enableBloom != 0)) {
|
|
(GHIDRA_CAST<RenderTarget *>((&DAT_00c798e0)))->RenderTarget::Clear();
|
|
local_2c.x = 0.0;
|
|
local_2c.y = 0.0;
|
|
std::vector::resize(&local_2c);
|
|
puVar4 = std::deque::back();
|
|
if (GHIDRA_CAST<byte *>((puVar4 + 1)) != GHIDRA_CAST<byte *>(0x0)) {
|
|
*GHIDRA_CAST<byte *>((puVar4 + 1)) = (byte)(g_graphicsManager_flags >> 5) & 1;
|
|
}
|
|
*puVar4 = g_graphicsManager_renderTarget;
|
|
(GHIDRA_CAST<KAGE_Graphics *>((&DAT_00c798e0)))->KAGE_Graphics::SetRenderTarget(DAT_00c79774,1);
|
|
}
|
|
room = this->_room;
|
|
if ((*room == '\0') || (g_game->_frameCount - *GHIDRA_CAST<int *>((room + 0x11f0)) != 0x1e)) {
|
|
LAB_006fbf42:
|
|
if (this->_isRoomSnapshotTaken != 0xff) {
|
|
isRoomSnapshot = '\0';
|
|
goto LAB_006fbfa2;
|
|
}
|
|
}
|
|
else {
|
|
local_48._blue = 1.26117e-44;
|
|
local_48._alpha = 7.00649e-45;
|
|
uVar5 = *GHIDRA_CAST<uint *>((*GHIDRA_CAST<int *>((room + 4)) + 0x5c));
|
|
local_78 = GHIDRA_CAST<undefined4 *>(0x19);
|
|
if (uVar5 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar5 = uVar5 >> 9 ^ uVar5;
|
|
uVar5 = uVar5 << 5 ^ uVar5;
|
|
uVar5 = uVar5 >> 0x19 ^ uVar5;
|
|
if ((uVar5 != (uVar5 / 3) * 3) && (this->_isRoomSnapshotTaken != 0)) goto LAB_006fbf42;
|
|
}
|
|
isRoomSnapshot = '\x01';
|
|
local_2c.x = 0.0;
|
|
local_2c.y = 0.0;
|
|
std::vector::resize(&local_2c);
|
|
puVar4 = std::deque::back();
|
|
if (GHIDRA_CAST<byte *>((puVar4 + 1)) != GHIDRA_CAST<byte *>(0x0)) {
|
|
*GHIDRA_CAST<byte *>((puVar4 + 1)) = (byte)(g_graphicsManager_flags >> 5) & 1;
|
|
}
|
|
*puVar4 = g_graphicsManager_renderTarget;
|
|
(GHIDRA_CAST<KAGE_Graphics *>((&DAT_00c798e0)))->KAGE_Graphics::SetRenderTarget(DAT_00c797a4,1);
|
|
this->_isRoomSnapshotTaken = 1;
|
|
LAB_006fbfa2:
|
|
FUN_008f7420();
|
|
iVar6 = *GHIDRA_CAST<int *>(&this->_roomTransition);
|
|
if (((((iVar6 == 2) || (iVar6 == 3)) && ((this->_roomTransition)._bossIntroBossId != 0)) &&
|
|
(iVar6 == 2)) || ((g_manager->_optionsConfig)._enableColorModifier == 0)) {
|
|
isColorModifierActive = '\0';
|
|
}
|
|
else {
|
|
isColorModifierActive = '\x01';
|
|
local_2c.x = 0.0;
|
|
local_2c.y = 0.0;
|
|
std::vector::resize(&local_2c);
|
|
local_78 = std::deque::back();
|
|
if (GHIDRA_CAST<byte *>((local_78 + 1)) != GHIDRA_CAST<byte *>(0x0)) {
|
|
*GHIDRA_CAST<byte *>((local_78 + 1)) = (byte)(g_graphicsManager_flags >> 5) & 1;
|
|
}
|
|
*local_78 = g_graphicsManager_renderTarget;
|
|
(GHIDRA_CAST<KAGE_Graphics *>((&DAT_00c798e0)))->KAGE_Graphics::SetRenderTarget(DAT_00c797ac,1);
|
|
}
|
|
(GHIDRA_CAST<RenderTarget *>((&DAT_00c798e0)))->RenderTarget::Clear();
|
|
g_graphicsManager_blendMode[1] = 1;
|
|
g_graphicsManager_blendMode[0] = 0;
|
|
if ((g_graphicsManager_flags & 4) == 0) {
|
|
g_graphicsManager_blendMode[1] = 6;
|
|
}
|
|
g_graphicsManager_blendMode[2] = 7;
|
|
g_graphicsManager_blendMode[3] = 1;
|
|
g_graphicsManager_blendMode[4] = 7;
|
|
if ((*GHIDRA_CAST<int *>(&this->_roomTransition) == 2) || (*GHIDRA_CAST<int *>(&this->_roomTransition) == 3)) {
|
|
(GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(&this->_roomTransition))))->Entity_Player::TriggerRoomExit();
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Room *>((this->_room)))->Room::Render();
|
|
}
|
|
LuaEngine::PostRender();
|
|
iVar6 = this->_hallucinationDuration + -0x14;
|
|
if (iVar6 < 0) {
|
|
iVar6 = 0;
|
|
}
|
|
if (((iVar6 < this->_hallucinationTimer) && (isRoomSnapshot == '\0')) &&
|
|
(DAT_00c797a4 != GHIDRA_CAST<int *>(0x0))) {
|
|
quadBottomLeftX = 0;
|
|
quadParams = 0;
|
|
quadTopRightY = 0;
|
|
quadTopLeftY = 0;
|
|
local_8c = 0;
|
|
quadBottomRightX = 0x3f800000;
|
|
local_a4 = 0x3f800000;
|
|
quadBottomRightY = 0x3f800000;
|
|
quadBottomLeftY = 0x3f800000;
|
|
(GHIDRA_CAST<KColor *>((&local_48)))->KColor::SetFromARGB(0xffffffff);
|
|
render_quad_set_uniform_color(screenQuad,0.0,0.0,g_screenWidth,g_screenHeight,color_00);
|
|
stageTransitionProgress = sin(((float)((this->_hallucinationTimer - this->_hallucinationDuration) + 0x14) *
|
|
3.1415927) / 20.0);
|
|
local_48._unk = 0;
|
|
local_48._red = 1.0;
|
|
local_48._green = 1.0;
|
|
local_48._alpha = stageTransitionProgress * 0.5;
|
|
local_48._blue = 1.0;
|
|
(**(code **)(*DAT_00c797a4 + 0x14))(&quadParams);
|
|
}
|
|
if (isColorModifierActive != '\0') {
|
|
_glfw_context_reset();
|
|
pop_render_target();
|
|
(GHIDRA_CAST<RenderTarget *>((&DAT_00c798e0)))->RenderTarget::Clear();
|
|
shader = &DAT_00c79348;
|
|
if ((DAT_00c7934c & 1) == 0) {
|
|
shader = g_currentShader;
|
|
}
|
|
g_graphicsManager_blendMode[0] = 0;
|
|
g_graphicsManager_blendMode[1] = 1;
|
|
g_graphicsManager_blendMode[2] = 0;
|
|
g_graphicsManager_blendMode[3] = 1;
|
|
g_graphicsManager_blendMode[4] = 0;
|
|
g_currentShader = shader;
|
|
(GHIDRA_CAST<Shader *>((shader)))->Shader::set_uniform(GHIDRA_CAST<byte *>("Amount"),8,&(this->_currentColorModifier)._amount,GHIDRA_INT(shader));
|
|
(GHIDRA_CAST<Shader *>((g_currentShader)))->Shader::set_uniform(GHIDRA_CAST<byte *>("Brightness"),8,
|
|
&(this->_currentColorModifier)._brightness,unused);
|
|
(GHIDRA_CAST<Shader *>((g_currentShader)))->Shader::set_uniform(GHIDRA_CAST<byte *>("Contrast"),8,
|
|
&(this->_currentColorModifier)._contrast,unused_00);
|
|
quadBottomLeftX = 0;
|
|
quadParams = 0;
|
|
quadTopRightY = 0;
|
|
quadTopLeftY = 0;
|
|
quadBottomRightX = 0x3f800000;
|
|
local_a4 = 0x3f800000;
|
|
quadBottomRightY = 0x3f800000;
|
|
quadBottomLeftY = 0x3f800000;
|
|
local_8c = 0;
|
|
(GHIDRA_CAST<KColor *>((&local_48)))->KColor::SetFromARGB(0xffffffff);
|
|
render_quad_set_uniform_color(screenQuad,0.0,0.0,g_screenWidth,g_screenHeight,color_01);
|
|
local_48._red = (this->_currentColorModifier)._red;
|
|
local_48._green = (this->_currentColorModifier)._green;
|
|
local_48._unk = 0;
|
|
local_48._alpha = 1.0;
|
|
local_48._blue = (this->_currentColorModifier)._blue;
|
|
(**(code **)(*DAT_00c797ac + 0x14))(&quadParams);
|
|
g_graphicsManager_blendMode[1] = 1;
|
|
g_graphicsManager_blendMode[0] = 0;
|
|
if ((g_graphicsManager_flags & 4) == 0) {
|
|
g_graphicsManager_blendMode[1] = 6;
|
|
}
|
|
g_graphicsManager_blendMode[2] = 7;
|
|
g_graphicsManager_blendMode[3] = 1;
|
|
g_graphicsManager_blendMode[4] = 7;
|
|
shader_cache_find(6);
|
|
}
|
|
(GHIDRA_CAST<DebugRenderer *>((&this->_debugRenderer)))->DebugRenderer::Render();
|
|
PopupQueue::render_layer();
|
|
(GHIDRA_CAST<HUD *>((&this->_hud)))->HUD::Render();
|
|
if (*GHIDRA_CAST<int *>(&this->_deathmatchManager) == 4) {
|
|
(**(code **)(*GHIDRA_CAST<int *>((this->_deathmatchManager)._type) + 0x18))();
|
|
}
|
|
(GHIDRA_CAST<StageTransition *>((&this->_stageTransition)))->StageTransition::Render();
|
|
(GHIDRA_CAST<ItemOverlay *>((&this->_itemOverlay)))->ItemOverlay::Render();
|
|
FUN_00421400();
|
|
PopupQueue::render_layer();
|
|
if ((((this->_genericPrompt)._sprite._animState._animData != (void *)0x0) &&
|
|
((this->_genericPrompt)._sprite._animState._isPlaying != 0)) &&
|
|
((GHIDRA_CAST<GenericPrompt *>((&this->_genericPrompt)))->GenericPrompt::Render(), (this->_genericPrompt)._isOnlineVote != 0)) {
|
|
local_84.y = g_screenHeight - 55.0;
|
|
local_84.x = g_screenWidth * 0.5 - 32.0;
|
|
(GHIDRA_CAST<ANM2 *>((&this->_completionWidgetSprite)))->ANM2::Render(&local_84,&g_vectorZero,&g_vectorZero);
|
|
sprintf(GHIDRA_CAST<byte *>(&local_48._green),GHIDRA_CAST<byte *>("%d/%d"));
|
|
manager = g_manager;
|
|
FUN_00a1a580();
|
|
local_14 = 0;
|
|
(GHIDRA_CAST<KColor *>((&local_c0)))->KColor::SetFromARGB(0xff362f2d);
|
|
local_78 = GHIDRA_CAST<undefined4 *>((local_84.x + 28.0));
|
|
local_2c.y = local_84.y + 6.0;
|
|
local_2c.x = (float)local_78;
|
|
Font::DrawStringScaled
|
|
(&manager->_font2_TeamMeatEx12,GHIDRA_CAST<byte *>(&local_48._green),&local_2c,color_02,&local_a4);
|
|
local_14 = 0xffffffff;
|
|
if (DAT_00c79880 != 0) {
|
|
FUN_0091cac0();
|
|
sprintf(GHIDRA_CAST<byte *>(&local_48._green),s__d);
|
|
manager = g_manager;
|
|
FUN_00a1a580();
|
|
local_14 = 1;
|
|
(GHIDRA_CAST<KColor *>((&local_c0)))->KColor::SetFromARGB(0xff362f2d);
|
|
local_2c.y = local_84.y + 28.0;
|
|
local_2c.x = (float)local_78;
|
|
Font::DrawStringScaled
|
|
(&manager->_font2_TeamMeatEx12,GHIDRA_CAST<byte *>(&local_48._green),&local_2c,color_03,&local_a4
|
|
);
|
|
local_14 = 0xffffffff;
|
|
}
|
|
}
|
|
if ((this->_pauseScreen)._state != 0) {
|
|
(GHIDRA_CAST<PauseScreen *>((&this->_pauseScreen)))->PauseScreen::Render();
|
|
}
|
|
(GHIDRA_CAST<EmoteWheel *>((&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x25108))))))->EmoteWheel::Render();
|
|
RevivePlayerMenu::Render();
|
|
(GHIDRA_CAST<GameOver *>((&this->_gameOver)))->GameOver::Render();
|
|
(GHIDRA_CAST<Leaderboard *>((&this->_leaderboard)))->Leaderboard::Render();
|
|
netplay_lobby_render(&this->_onlineStatsScreen);
|
|
PopupQueue::render_layer();
|
|
render_mod_shaders();
|
|
if (isRoomSnapshot != '\0') {
|
|
_glfw_context_reset();
|
|
pop_render_target();
|
|
(GHIDRA_CAST<RenderTarget *>((&DAT_00c798e0)))->RenderTarget::Clear();
|
|
set_blend_mode(&DAT_00c798e0,0);
|
|
quadBottomLeftX = 0;
|
|
quadParams = 0;
|
|
quadTopRightY = 0;
|
|
quadTopLeftY = 0;
|
|
quadBottomRightX = 0x3f800000;
|
|
local_a4 = 0x3f800000;
|
|
quadBottomRightY = 0x3f800000;
|
|
quadBottomLeftY = 0x3f800000;
|
|
local_8c = 0;
|
|
(GHIDRA_CAST<KColor *>((&local_c0)))->KColor::SetFromARGB(0xffffffff);
|
|
render_quad_set_uniform_color(snapshotQuad,0.0,0.0,g_screenWidth,g_screenHeight,color_04);
|
|
(**(code **)(*DAT_00c797a4 + 0x14))(&quadParams);
|
|
}
|
|
if ((0 < this->_bloomTimer) && ((g_manager->_optionsConfig)._enableBloom != 0)) {
|
|
_glfw_context_reset();
|
|
pop_render_target();
|
|
(GHIDRA_CAST<RenderTarget *>((&DAT_00c798e0)))->RenderTarget::Clear();
|
|
set_blend_mode(&DAT_00c798e0,0);
|
|
shader = &DAT_00c792f8;
|
|
if ((DAT_00c792fc & 1) == 0) {
|
|
shader = g_currentShader;
|
|
}
|
|
stageTransitionProgress = (float)this->_bloomDuration * 0.5;
|
|
g_currentShader = shader;
|
|
stageTransitionProgress = sin((1.0 - ABS((float)this->_bloomTimer - stageTransitionProgress) / stageTransitionProgress) * 3.1415927 * 0.5);
|
|
local_78 = GHIDRA_CAST<undefined4 *>((stageTransitionProgress * this->_bloomStrength));
|
|
local_2c.y = 2.0 / (float)((double)DAT_00c79774[7] +
|
|
__uint_to_double_fixup[-(DAT_00c79774[7] >> 0x1f)]);
|
|
local_2c.x = 2.0 / (float)((double)DAT_00c79774[6] +
|
|
__uint_to_double_fixup[-(DAT_00c79774[6] >> 0x1f)]);
|
|
(GHIDRA_CAST<Shader *>((shader)))->Shader::set_uniform(GHIDRA_CAST<byte *>("BloomAmount"),8,&local_78,GHIDRA_INT(DAT_00c79774));
|
|
(GHIDRA_CAST<Shader *>((g_currentShader)))->Shader::set_uniform(GHIDRA_CAST<byte *>("Ratio"),9,&local_2c,unused_01);
|
|
bloomBottomLeftX = 0;
|
|
bloomParams = 0;
|
|
bloomTopRightY = 0;
|
|
bloomTopLeftY = 0;
|
|
bloomBottomRightX = 0x3f800000;
|
|
bloomTopRightX = 0x3f800000;
|
|
bloomBottomRightY = 0x3f800000;
|
|
bloomBottomLeftY = 0x3f800000;
|
|
local_f8 = 0;
|
|
(GHIDRA_CAST<KColor *>((&local_c0)))->KColor::SetFromARGB(0xffffffff);
|
|
render_quad_set_uniform_color(bloomQuad,0.0,0.0,g_screenWidth,g_screenHeight,color_05);
|
|
(**(code **)(*DAT_00c79774 + 0x14))(&bloomParams);
|
|
}
|
|
if ((g_manager->_optionsConfig)._enablePixelation != 0) {
|
|
puVar4 = GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<StageTransition *>((&this->_stageTransition)))->StageTransition)::get_fade_progress();
|
|
stageTransitionProgress = 0.0;
|
|
if (((0.0 <= (float)puVar4) && (cVar2 = FUN_009301d0(), cVar2 != '\0')) ||
|
|
((FUN_00832fd0(), stageTransitionProgress <= (float)puVar4 && ((this->_roomTransition)._animation == 2)))) {
|
|
_glfw_context_reset();
|
|
pop_render_target();
|
|
(GHIDRA_CAST<RenderTarget *>((&DAT_00c798e0)))->RenderTarget::Clear();
|
|
FUN_00832fd0();
|
|
local_78 = puVar4;
|
|
local_84.y = (GHIDRA_CAST<StageTransition *>((&this->_stageTransition)))->StageTransition::get_fade_progress();
|
|
fadeAmountPtr = GHIDRA_CAST<float *>(&local_78);
|
|
if ((float)puVar4 <= local_84.y) {
|
|
fadeAmountPtr = &local_84.y;
|
|
}
|
|
shader = &DAT_00c792a8;
|
|
if ((DAT_00c792ac & 1) == 0) {
|
|
shader = g_currentShader;
|
|
}
|
|
local_78 = GHIDRA_CAST<undefined4 *>(0x38d1b717);
|
|
local_84.y = *fadeAmountPtr * 0.3;
|
|
pixelationAmountPtr = &local_84.y;
|
|
if (*fadeAmountPtr * 0.3 <= 0.0001) {
|
|
pixelationAmountPtr = GHIDRA_CAST<float *>(&local_78);
|
|
}
|
|
local_84.y = *pixelationAmountPtr;
|
|
screenSize = (float)((double)DAT_00c79758[4] +
|
|
__uint_to_double_fixup[-(DAT_00c79758[4] >> 0x1f)]);
|
|
screenSizeY = (float)((double)DAT_00c79758[5] +
|
|
__uint_to_double_fixup[-(DAT_00c79758[5] >> 0x1f)]);
|
|
local_2c.y = (float)((double)DAT_00c79758[7] +
|
|
__uint_to_double_fixup[-(DAT_00c79758[7] >> 0x1f)]);
|
|
local_2c.x = (float)((double)DAT_00c79758[6] +
|
|
__uint_to_double_fixup[-(DAT_00c79758[6] >> 0x1f)]);
|
|
g_currentShader = shader;
|
|
(GHIDRA_CAST<Shader *>((shader)))->Shader::set_uniform(GHIDRA_CAST<byte *>("PixelationAmount"),8,&local_84.y,GHIDRA_INT(DAT_00c79758));
|
|
(GHIDRA_CAST<Shader *>((g_currentShader)))->Shader::set_uniform(GHIDRA_CAST<byte *>("ScreenSize"),0xb,&screenSize,unused_02);
|
|
pixelationBottomLeftX = 0;
|
|
pixelationParams = 0;
|
|
pixelationTopRightY = 0;
|
|
pixelationTopLeftY = 0;
|
|
pixelationBottomRightX = 0x3f800000;
|
|
pixelationTopRightX = 0x3f800000;
|
|
pixelationBottomRightY = 0x3f800000;
|
|
pixelationBottomLeftY = 0x3f800000;
|
|
local_11c = 0;
|
|
(GHIDRA_CAST<KColor *>((&local_c0)))->KColor::SetFromARGB(0xffffffff);
|
|
render_quad_set_uniform_color(overlayQuad,0.0,0.0,g_screenWidth,g_screenHeight,color_06);
|
|
(**(code **)(*DAT_00c79758 + 0x14))(&pixelationParams);
|
|
}
|
|
}
|
|
if (0 < this->_hallucinationTimer) {
|
|
_glfw_context_reset();
|
|
pop_render_target();
|
|
(GHIDRA_CAST<RenderTarget *>((&DAT_00c798e0)))->RenderTarget::Clear();
|
|
set_blend_mode(&DAT_00c798e0,0);
|
|
shaderBottomLeftX = 0;
|
|
shaderParams = 0;
|
|
shaderTopRightY = 0;
|
|
shaderTopLeftY = 0;
|
|
shaderBottomRightX = 0x3f800000;
|
|
shaderTopRightX = 0x3f800000;
|
|
shaderBottomRightY = 0x3f800000;
|
|
shaderBottomLeftY = 0x3f800000;
|
|
local_d4 = 0;
|
|
(GHIDRA_CAST<KColor *>((&local_c0)))->KColor::SetFromARGB(0xffffffff);
|
|
render_quad_set_uniform_color(screenQuad,0.0,0.0,g_screenWidth,g_screenHeight,color_07);
|
|
local_78 = GHIDRA_CAST<undefined4 *>(0x3f800000);
|
|
shader = &DAT_00c794d8;
|
|
if ((DAT_00c794dc & 1) == 0) {
|
|
shader = g_currentShader;
|
|
}
|
|
iVar6 = this->_hallucinationTimer;
|
|
iVar7 = this->_hallucinationDuration + -10;
|
|
if (iVar7 < iVar6) {
|
|
local_78 = GHIDRA_CAST<undefined4 *>((1.0 - (float)(iVar6 - iVar7) / 10.0));
|
|
}
|
|
else if (iVar6 < 10) {
|
|
local_78 = GHIDRA_CAST<undefined4 *>(((float)iVar6 / 10.0));
|
|
}
|
|
screenSize = (float)((double)DAT_00c7979c[4] +
|
|
__uint_to_double_fixup[-(DAT_00c7979c[4] >> 0x1f)]);
|
|
screenSizeY = (float)((double)DAT_00c7979c[5] +
|
|
__uint_to_double_fixup[-(DAT_00c7979c[5] >> 0x1f)]);
|
|
local_2c.y = (float)((double)DAT_00c7979c[7] +
|
|
__uint_to_double_fixup[-(DAT_00c7979c[7] >> 0x1f)]);
|
|
local_2c.x = (float)((double)DAT_00c7979c[6] +
|
|
__uint_to_double_fixup[-(DAT_00c7979c[6] >> 0x1f)]);
|
|
g_currentShader = shader;
|
|
(GHIDRA_CAST<Shader *>((shader)))->Shader::set_uniform(GHIDRA_CAST<byte *>("Amount"),8,&local_78,GHIDRA_INT(DAT_00c7979c));
|
|
(GHIDRA_CAST<Shader *>((g_currentShader)))->Shader::set_uniform(GHIDRA_CAST<byte *>("ScreenSize"),0xb,&screenSize,unused_03);
|
|
puVar9 = screenQuad;
|
|
(**(code **)(*DAT_00c7979c + 0x14))(&shaderParams);
|
|
if ((float)local_78 < 0.999) {
|
|
uVar5 = g_manager->_framecount & 0x80000003;
|
|
if (GHIDRA_INT(uVar5) < 0) {
|
|
uVar5 = (uVar5 - 1 | 0xfffffffc) + 1;
|
|
}
|
|
if ((uVar5 == 1) || (uVar5 == 3)) {
|
|
isFlipX = true;
|
|
}
|
|
else {
|
|
isFlipX = false;
|
|
}
|
|
if ((uVar5 == 2) || (uVar5 == 3)) {
|
|
isFlipY = true;
|
|
local_c0._green = 0.0;
|
|
}
|
|
else {
|
|
isFlipY = false;
|
|
iVar6 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(this->_giantBookClickerImage) + 0x14));
|
|
local_c0._green = (float)((double)iVar6 + __uint_to_double_fixup[-(iVar6 >> 0x1f)]);
|
|
}
|
|
if (isFlipX) {
|
|
clickerQuadTopRightX = 0.0;
|
|
}
|
|
else {
|
|
iVar6 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(this->_giantBookClickerImage) + 0x10));
|
|
clickerQuadTopRightX = (float)((double)iVar6 + __uint_to_double_fixup[-(iVar6 >> 0x1f)]);
|
|
}
|
|
if (isFlipY) {
|
|
iVar6 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(this->_giantBookClickerImage) + 0x14));
|
|
clickerQuadTopLeftY = (float)((double)iVar6 + __uint_to_double_fixup[-(iVar6 >> 0x1f)]);
|
|
}
|
|
else {
|
|
clickerQuadTopLeftY = 0.0;
|
|
}
|
|
clickerQuadTopLeftX = 0.0;
|
|
if (isFlipX) {
|
|
iVar6 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(this->_giantBookClickerImage) + 0x10));
|
|
clickerQuadTopLeftX = (float)((double)iVar6 + __uint_to_double_fixup[-(iVar6 >> 0x1f)]);
|
|
}
|
|
shader = &g_shaders;
|
|
if ((DAT_00c7911c & 1) == 0) {
|
|
shader = g_currentShader;
|
|
}
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_c0._unk)) + 0x0))) = 1;
|
|
pvVar10 = (void *)0x6fce6d;
|
|
g_currentShader = shader;
|
|
clickerQuadTopRightY = clickerQuadTopLeftY;
|
|
local_c0._red = clickerQuadTopLeftX;
|
|
local_c0._blue = clickerQuadTopRightX;
|
|
local_c0._alpha = local_c0._green;
|
|
(GHIDRA_CAST<Color *>((&clickerColor)))->Color::Color();
|
|
(GHIDRA_CAST<KAGE::SmartPointer *>((auStack_30a + -10)))->KAGE::SmartPointer::operator_assign(this->_giantBookClickerImage);
|
|
apply_sprite_shader_params(color,1,puVar9,pvVar10);
|
|
local_48._unk = 0;
|
|
local_48._red = 1.0;
|
|
local_48._green = 1.0;
|
|
local_48._alpha = 1.0 - (float)local_78;
|
|
local_48._blue = 1.0;
|
|
(**(code **)(**GHIDRA_CAST<int **>(this->_giantBookClickerImage) + 0x14))(&clickerQuadTopLeftX);
|
|
this = local_88;
|
|
}
|
|
}
|
|
bVar3 = IsInTimedSet(g_game,8);
|
|
iVar6 = extraout_ECX;
|
|
if (bVar3 != 0) {
|
|
_glfw_context_reset();
|
|
pop_render_target();
|
|
(GHIDRA_CAST<RenderTarget *>((&DAT_00c798e0)))->RenderTarget::Clear();
|
|
set_blend_mode(&DAT_00c798e0,0);
|
|
shaderBottomLeftX = 0;
|
|
shaderParams = 0;
|
|
shaderTopRightY = 0;
|
|
shaderTopLeftY = 0;
|
|
shaderBottomRightX = 0x3f800000;
|
|
shaderTopRightX = 0x3f800000;
|
|
shaderBottomRightY = 0x3f800000;
|
|
shaderBottomLeftY = 0x3f800000;
|
|
local_d4 = 0;
|
|
(GHIDRA_CAST<KColor *>((&local_c0)))->KColor::SetFromARGB(0xffffffff);
|
|
render_quad_set_uniform_color(overlayQuad,0.0,0.0,g_screenWidth,g_screenHeight,color_08);
|
|
shader = &DAT_00c79438;
|
|
if ((DAT_00c7943c & 1) == 0) {
|
|
shader = g_currentShader;
|
|
}
|
|
local_88 = GHIDRA_CAST<Game *>(((float)g_game->_frameCount * 0.05));
|
|
screenSize = (float)((double)DAT_00c79794[4] +
|
|
__uint_to_double_fixup[-(DAT_00c79794[4] >> 0x1f)]);
|
|
screenSizeY = (float)((double)DAT_00c79794[5] +
|
|
__uint_to_double_fixup[-(DAT_00c79794[5] >> 0x1f)]);
|
|
local_2c.y = (float)((double)DAT_00c79794[7] +
|
|
__uint_to_double_fixup[-(DAT_00c79794[7] >> 0x1f)]);
|
|
local_2c.x = (float)((double)DAT_00c79794[6] +
|
|
__uint_to_double_fixup[-(DAT_00c79794[6] >> 0x1f)]);
|
|
g_currentShader = shader;
|
|
(GHIDRA_CAST<Shader *>((shader)))->Shader::set_uniform(&DAT_00b6837c,8,&local_88,GHIDRA_INT(DAT_00c79794));
|
|
(GHIDRA_CAST<Shader *>((g_currentShader)))->Shader::set_uniform(GHIDRA_CAST<byte *>("ScreenSize"),0xb,&screenSize,unused_04);
|
|
(**(code **)(*DAT_00c79794 + 0x14))(&shaderParams);
|
|
iVar6 = extraout_ECX_00;
|
|
}
|
|
shader_cache_find(iVar6);
|
|
if (0 < this->_ascentTimer) {
|
|
set_blend_mode(&DAT_00c798e0,2);
|
|
local_48._unk = 0;
|
|
local_48._red = 1.0;
|
|
local_48._alpha = (float)this->_ascentTimer / 90.0;
|
|
local_48._green = 1.0;
|
|
if (local_48._alpha <= 0.0) {
|
|
local_48._alpha = 0.0;
|
|
}
|
|
if (1.0 <= local_48._alpha) {
|
|
local_48._alpha = 1.0;
|
|
}
|
|
local_48._blue = 1.0;
|
|
render_quad_set_uniform_color(overlayQuad,0.0,0.0,g_screenWidth,g_screenHeight,&local_48);
|
|
render_color_shader_pass(overlayQuad);
|
|
set_blend_mode(&DAT_00c798e0,1);
|
|
}
|
|
stageTransitionProgress = 0.0;
|
|
if ((this->_fadeInColor)._alpha <= 0.0) {
|
|
if (0.0 < (this->_fadeOutColor)._alpha) {
|
|
render_quad_set_uniform_color
|
|
(overlayQuad,0.0,0.0,g_screenWidth,g_screenHeight,&this->_fadeOutColor);
|
|
render_color_shader_pass(overlayQuad);
|
|
}
|
|
}
|
|
else {
|
|
set_blend_mode(&DAT_00c798e0,1);
|
|
render_quad_set_uniform_color
|
|
(overlayQuad,0.0,stageTransitionProgress,g_screenWidth,g_screenHeight,&this->_fadeInColor);
|
|
render_color_shader_pass(overlayQuad);
|
|
if (this->_isFadeInIconShown != 0) {
|
|
Manager::render_loading_icon((this->_fadeInColor)._alpha);
|
|
}
|
|
}
|
|
if (((GHIDRA_UINT(this->_debugFlags) >> 0xb & 1) != 0) &&
|
|
(GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2 != 0)) {
|
|
debugPlayer = GetPlayer(g_game,0);
|
|
local_2c.x = 10.0;
|
|
local_2c.y = 10.0;
|
|
render_debug_player_info(debugPlayer,&local_2c);
|
|
}
|
|
if ((g_manager->_netplayManager != *GHIDRA_CAST<NetplayManager *>((g_manager + 1))) &&
|
|
(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(g_manager[1]._gamestate)) + 0x220)))) != 0)) {
|
|
desyncFont = &g_manager->_font6_PFTempestaSevenCondensed;
|
|
stageTransitionProgress = sin(((float)(g_manager->_framecount % 0x1e) * 3.1415927) / 15.0);
|
|
stageTransitionProgress = stageTransitionProgress * 0.15 + 0.15;
|
|
FUN_00a1a580();
|
|
local_14 = 2;
|
|
local_48._unk = 0;
|
|
local_48._red = 1.0;
|
|
local_48._alpha = 1.0;
|
|
local_48._blue = stageTransitionProgress;
|
|
pos.y = 10.0;
|
|
pos.x = g_screenWidth * 0.5;
|
|
local_48._green = stageTransitionProgress;
|
|
(GHIDRA_CAST<Font *>((desyncFont)))->Font::DrawString(GHIDRA_CAST<byte *>("DESYNCED"),pos,(Vector)0x4000000040000000,&local_48,settings);
|
|
local_14 = 0xffffffff;
|
|
}
|
|
render_debug_lua_memory();
|
|
(GHIDRA_CAST<Console *>((&this->_console)))->Console::Render();
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 006fd350
|
|
byte Game::IsPaused()
|
|
{
|
|
byte isScreenTransitionActive;
|
|
int extraout_EDX;
|
|
int extraout_EDX_00;
|
|
int itemOverlayState;
|
|
Manager *manager;
|
|
|
|
manager = g_manager;
|
|
if (this->_console != (Console)0x0) {
|
|
if (g_manager->_netplayManager == *GHIDRA_CAST<NetplayManager *>((g_manager + 1))) {
|
|
return 1;
|
|
}
|
|
if ((GHIDRA_INT(*GHIDRA_CAST<NetplayManager *>((g_manager + 1))) - GHIDRA_INT(g_manager->_netplayManager) & 0xfffffffcU) ==
|
|
4) {
|
|
return 1;
|
|
}
|
|
}
|
|
if ((((((this->_freezeFrames < 1) && (*GHIDRA_CAST<int *>(&this->_gameOver) == 0)) &&
|
|
((this->_leaderboard)._state == 0)) &&
|
|
((*GHIDRA_CAST<int *>(&this->_stageTransition) == 0 && (*GHIDRA_CAST<int *>(&this->_roomTransition) == 0)))) &&
|
|
((itemOverlayState = (this->_itemOverlay)._state, itemOverlayState == 0 ||
|
|
(itemOverlayState != 2)))) &&
|
|
((((isScreenTransitionActive = is_single_player(&this->_pauseScreen),
|
|
isScreenTransitionActive == 0 && (manager->_state == 2)) &&
|
|
(isScreenTransitionActive = is_screen_transition_active((void *)(extraout_EDX + 0x26778)),
|
|
isScreenTransitionActive == 0)) && (*GHIDRA_CAST<char *>((extraout_EDX_00 + 0x25954)) == '\0')))) {
|
|
return 0;
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 006fd3f0
|
|
void Game::interpolate_update()
|
|
{
|
|
int iVar1;
|
|
int iVar2;
|
|
Entity_Player *player;
|
|
Entity *pEVar3;
|
|
byte isConsoleBlocking;
|
|
void *pvVar4;
|
|
uint i;
|
|
float scrollStep;
|
|
undefined4 flagsHigh;
|
|
Game *game;
|
|
int sortingLayer;
|
|
int *tmpEntity;
|
|
|
|
game = g_game;
|
|
isConsoleBlocking = (GHIDRA_CAST<Console *>((&g_game->_console)))->Console::update_state();
|
|
if (isConsoleBlocking == 0) {
|
|
iVar1 = *GHIDRA_CAST<int *>(&game->_roomTransition);
|
|
if (iVar1 == 0) {
|
|
iVar1 = *GHIDRA_CAST<int *>(&game->_stageTransition);
|
|
if ((iVar1 != 0) && ((iVar1 == 1 || (iVar1 == 4)))) {
|
|
i = 0;
|
|
pvVar4 = g_game->_room;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar4) + 0x1264)) != 0) {
|
|
do {
|
|
player = *GHIDRA_CAST<Entity_Player **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar4) + 0x125c)) + i * 4));
|
|
if (player->_type == 1) {
|
|
flagsHigh = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&player->_flags) + 4));
|
|
*GHIDRA_CAST<uint *>(&player->_flags) = GHIDRA_UINT(player->_flags) | 0x4000;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&player->_flags) + 4)) = flagsHigh;
|
|
player->Update();
|
|
flagsHigh = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&player->_flags) + 4));
|
|
*GHIDRA_CAST<uint *>(&player->_flags) = GHIDRA_UINT(player->_flags) & 0xffffbfff;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&player->_flags) + 4)) = flagsHigh;
|
|
StageTransition::update_player_trapdoor_scale(&game->_stageTransition,player,1);
|
|
}
|
|
else if ((player->_flags & 0x100000000000) != 0) {
|
|
player->Interpolate();
|
|
}
|
|
i = i + 1;
|
|
} while (i < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(pvVar4) + 0x1264)));
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
iVar2 = (game->_roomTransition)._duration;
|
|
if ((game->_roomTransition)._frame != iVar2) {
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((game->_roomTransition))) + 0xc)))) =
|
|
0.5 / (float)iVar2 + *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((game->_roomTransition))) + 0xc))));
|
|
}
|
|
if ((iVar1 == 1) || (iVar1 == 4)) {
|
|
i = 0;
|
|
pvVar4 = g_game->_room;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar4) + 0x1264)) != 0) {
|
|
do {
|
|
tmpEntity = *GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar4) + 0x125c)) + i * 4));
|
|
if (tmpEntity[10] == 1) {
|
|
tmpEntity[0x5a] = tmpEntity[0x5a] | 0x4000;
|
|
tmpEntity[0x5b] = tmpEntity[0x5b];
|
|
(**(code **)(*tmpEntity + 0xc))();
|
|
tmpEntity[0x5a] = tmpEntity[0x5a] & 0xffffbfff;
|
|
tmpEntity[0x5b] = tmpEntity[0x5b];
|
|
}
|
|
else if ((tmpEntity[0x5b] & 0x1000U) != 0) {
|
|
(**(code **)(*tmpEntity + 0x10))();
|
|
}
|
|
i = i + 1;
|
|
} while (i < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(pvVar4) + 0x1264)));
|
|
}
|
|
}
|
|
}
|
|
isConsoleBlocking = IsPaused(game);
|
|
if ((isConsoleBlocking == 0) &&
|
|
(((g_manager->_isWindowFocused != 0 ||
|
|
((g_manager->_optionsConfig)._enablePauseOnFocusLost == 0)) ||
|
|
(g_manager->_netplayManager != *GHIDRA_CAST<NetplayManager *>((g_manager + 1)))))) {
|
|
pvVar4 = game->_room;
|
|
i = 0;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar4) + 0x1264)) != 0) {
|
|
do {
|
|
pEVar3 = *GHIDRA_CAST<Entity **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar4) + 0x125c)) + i * 4));
|
|
iVar1 = *GHIDRA_CAST<int *>(pEVar3);
|
|
if (pEVar3->_type == 1) {
|
|
flagsHigh = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&pEVar3->_flags) + 4));
|
|
*GHIDRA_CAST<uint *>(&pEVar3->_flags) = GHIDRA_UINT(pEVar3->_flags) | 0x4000;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&pEVar3->_flags) + 4)) = flagsHigh;
|
|
(**(code **)(iVar1 + 0xc))();
|
|
(GHIDRA_CAST<Entity *>((pEVar3)))->Entity::PlayerCollideWithGrid(0);
|
|
flagsHigh = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&pEVar3->_flags) + 4));
|
|
*GHIDRA_CAST<uint *>(&pEVar3->_flags) = GHIDRA_UINT(pEVar3->_flags) & 0xffffbfff;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&pEVar3->_flags) + 4)) = flagsHigh;
|
|
}
|
|
else {
|
|
(**(code **)(iVar1 + 0x10))();
|
|
}
|
|
i = i + 1;
|
|
} while (i < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(pvVar4) + 0x1264)));
|
|
}
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar4) + 0x7884)) != '\0') {
|
|
i = 0;
|
|
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar4) + 0x776c));
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar4) + 0x7888)) =
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar4) + 0x788c)) * 0.5 + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar4) + 0x7888));
|
|
if (*GHIDRA_CAST<int *>((iVar1 + 0x1264)) != 0) {
|
|
do {
|
|
pEVar3 = *GHIDRA_CAST<Entity **>((*GHIDRA_CAST<int *>((iVar1 + 0x125c)) + i * 4));
|
|
iVar2 = pEVar3->_type;
|
|
if (iVar2 == 1) {
|
|
LAB_006fd6e6:
|
|
flagsHigh = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&pEVar3->_flags) + 4));
|
|
*GHIDRA_CAST<uint *>(&pEVar3->_flags) = GHIDRA_UINT(pEVar3->_flags) | 0x4000;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&pEVar3->_flags) + 4)) = flagsHigh;
|
|
(GHIDRA_CAST<Entity *>((pEVar3)))->Entity::PlayerCollideWithGrid(0);
|
|
flagsHigh = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&pEVar3->_flags) + 4));
|
|
*GHIDRA_CAST<uint *>(&pEVar3->_flags) = GHIDRA_UINT(pEVar3->_flags) & 0xffffbfff;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&pEVar3->_flags) + 4)) = flagsHigh;
|
|
}
|
|
else {
|
|
if (iVar2 != 3) {
|
|
scrollStep = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar4) + 0x788c));
|
|
sortingLayer = pEVar3->_sortingLayer;
|
|
(pEVar3->_pos).y = (pEVar3->_pos).y + 0.0;
|
|
if (sortingLayer == 0) {
|
|
scrollStep = scrollStep * 0.05;
|
|
}
|
|
else {
|
|
scrollStep = scrollStep * 0.5;
|
|
}
|
|
(pEVar3->_pos).x = scrollStep + (pEVar3->_pos).x;
|
|
}
|
|
if (iVar2 == 1) goto LAB_006fd6e6;
|
|
}
|
|
i = i + 1;
|
|
} while (i < *GHIDRA_CAST<uint *>((iVar1 + 0x1264)));
|
|
}
|
|
}
|
|
game = g_game;
|
|
i = 0;
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(pvVar4) + 0x7220)) = 1;
|
|
pvVar4 = (game->_playerManager)._extraPlayers._begin;
|
|
if (GHIDRA_INT((game->_playerManager)._extraPlayers._end) - GHIDRA_INT(pvVar4) >> 2 != 0) {
|
|
do {
|
|
tmpEntity = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(pvVar4) + i * 4));
|
|
tmpEntity[0x5a] = tmpEntity[0x5a] | 0x4000;
|
|
tmpEntity[0x5b] = tmpEntity[0x5b];
|
|
(**(code **)(*tmpEntity + 0xc))();
|
|
i = i + 1;
|
|
tmpEntity[0x5a] = tmpEntity[0x5a] & 0xffffbfff;
|
|
tmpEntity[0x5b] = tmpEntity[0x5b];
|
|
pvVar4 = (g_game->_playerManager)._extraPlayers._begin;
|
|
} while (i < GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._extraPlayers._end) - GHIDRA_INT(pvVar4) >> 2)));
|
|
}
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 006fdc10
|
|
void Game::StartStageTransition(byte isSameStage, int transitionOverride, Entity_Player *player)
|
|
{
|
|
NetplayManager unused;
|
|
NetplayManager NVar1;
|
|
EntityPtr player_00;
|
|
EntityPtr EVar2;
|
|
byte bVar3;
|
|
char cVar4;
|
|
uint uVar5;
|
|
byte *name;
|
|
int iVar6;
|
|
undefined4 forcedCurses;
|
|
uint forcedCurses;
|
|
uint preventedCurses;
|
|
Entity_Player *playerLocal;
|
|
undefined4 *playerIt;
|
|
void *pvVar8;
|
|
PlayerManager *playerManager;
|
|
int *piVar9;
|
|
int *piVar10;
|
|
undefined1 *size;
|
|
Game *game;
|
|
uint uVar11;
|
|
int iVar12;
|
|
ulonglong netUserId;
|
|
Leaderboard *userData;
|
|
int iStack_3c;
|
|
undefined8 uStack_38;
|
|
uint playerIdx;
|
|
void *leaderboardName [2];
|
|
int aiStack_24 [3];
|
|
undefined1 *local_18;
|
|
uint local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
int local_8;
|
|
|
|
game = g_game;
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00af32ed;
|
|
local_10 = ExceptionList;
|
|
uVar5 = __security_cookie ^ GHIDRA_UINT((aiStack_24 + 8));
|
|
ExceptionList = &local_10;
|
|
local_14 = uVar5;
|
|
if (6 < GHIDRA_UINT(transitionOverride)) {
|
|
KAGE_LogMessage(8,GHIDRA_CAST<byte *>("Invalid animation passed to (GHIDRA_CAST<Game *>(()))->Game::StartStageTransition()\n"));
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if ((((this->_dailyChallenge)._id != 0) && ((g_game->_dailyChallenge)._id != 0)) &&
|
|
((g_game->_dailyChallenge)._isPractice == 0)) {
|
|
userData = &g_game->_leaderboard;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(uStack_38)) + 0x4))) = 2.8026e-45;
|
|
unused = g_manager->_netplayManager;
|
|
NVar1 = *GHIDRA_CAST<NetplayManager *>((g_manager + 1));
|
|
iVar6 = 0;
|
|
if (unused != NVar1) {
|
|
iVar6 = 2;
|
|
}
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((g_game)) + 0x1d658)))) = iVar6;
|
|
if (unused != NVar1) {
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((game)) + 0x1d890)))) == 0) goto LAB_006fdcc2;
|
|
uVar11 = *GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((game)) + 0x1d890))));
|
|
}
|
|
else {
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((game)) + 0x1d888)))) == 0) {
|
|
LAB_006fdcc2:
|
|
name = leaderboard_name_format
|
|
(leaderboardName,(game->_dailyChallenge)._id,GHIDRA_INT(unused),iVar6);
|
|
local_8 = 0;
|
|
if (0xf < *GHIDRA_CAST<uint *>((name + 0x14))) {
|
|
name = *GHIDRA_CAST<byte **>(name);
|
|
}
|
|
leaderboard_find_async(name,0,FUN_0085ae10,userData);
|
|
local_8 = 0xffffffff;
|
|
if (&DAT_0000000f < local_18) {
|
|
size = local_18 + 1;
|
|
pvVar8 = leaderboardName[0];
|
|
if (GHIDRA_CAST<undefined1 *>(0xfff) < size) {
|
|
pvVar8 = *(void **)(GHIDRA_INT(leaderboardName[0]) + -4);
|
|
size = local_18 + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(leaderboardName[0]) + (-4 - GHIDRA_INT(pvVar8))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar8,GHIDRA_UINT(size));
|
|
}
|
|
aiStack_24[2] = 0;
|
|
local_18 = &DAT_0000000f;
|
|
leaderboardName[0] = (void *)(GHIDRA_UINT(leaderboardName[0]) & 0xffffff00);
|
|
goto LAB_006fdd5c;
|
|
}
|
|
uVar11 = *GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((game)) + 0x1d888))));
|
|
}
|
|
iVar6 = KAGE::System::LeaderboardManager::get_result(uVar11);
|
|
FUN_0085ae10(iVar6,userData,uVar5);
|
|
}
|
|
LAB_006fdd5c:
|
|
if (transitionOverride != 5) {
|
|
save_rewind_state(-1);
|
|
}
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("[Frame %d] Starting stage transition (transition type: %d) \n"));
|
|
uVar5 = *GHIDRA_CAST<uint *>((GHIDRA_INT(&this->_gameStateFlags) + 4)) & 0x10000;
|
|
if (isSameStage == 0) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(uStack_38)) + 0x4))) = (float)this->_stage;
|
|
if (uVar5 == 0) {
|
|
forcedCurses = 0;
|
|
}
|
|
else {
|
|
forcedCurses = CONCAT31((int3)(uVar5 >> 8),1);
|
|
}
|
|
FUN_009e5a30((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(uStack_38)) + 0x4))),this->_stageType,this->_timeCounter,forcedCurses);
|
|
uVar5 = g_game->_debugCurses;
|
|
uVar11 = g_game->_curses;
|
|
forcedCurses = Seeds::GetForcedCurses();
|
|
preventedCurses = Seeds::GetPreventedCurses();
|
|
if ((~preventedCurses & (forcedCurses | uVar5 | uVar11) & 2) != 0) {
|
|
bVar3 = GetStateFlag(this,0x30);
|
|
FUN_009e5a30((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_INT(uStack_38))) + 0x4))) + 1,this->_stageType,this->_timeCounter,bVar3);
|
|
}
|
|
}
|
|
else {
|
|
iStack_3c = this->_stage;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(uStack_38)) + 0x4))) = (float)CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uStack_38)) + 0x5))),uVar5 != 0);
|
|
piVar10 = *GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x26728))));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(uStack_38)) + 0x0))) = (float)this->_stageType;
|
|
if (piVar10 == *GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2672c))))) {
|
|
std::vector<12byte>::_Emplace_reallocate(piVar10,&iStack_3c);
|
|
}
|
|
else {
|
|
*piVar10 = iStack_3c;
|
|
piVar10[1] = GHIDRA_INT((float)uStack_38);
|
|
piVar10[2] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_INT(uStack_38))) + 0x4)));
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x26728)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x26728)))) + 0xc;
|
|
}
|
|
}
|
|
pvVar8 = (this->_playerManager)._playerList._begin;
|
|
playerIdx = 0;
|
|
if (GHIDRA_INT((this->_playerManager)._playerList._end) - GHIDRA_INT(pvVar8) >> 2 != 0) {
|
|
do {
|
|
player_00 = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(pvVar8) + playerIdx * 4));
|
|
EVar2 = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(player_00) + 0x1e68));
|
|
if ((((EVar2 == (EntityPtr)0x0) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar2) + 0x161c)) == -1)) ||
|
|
((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(player_00) + 0x161c)) <= *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar2) + 0x161c)) ||
|
|
(EVar2 == player_00)))) && (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2)) {
|
|
netUserId = player_get_net_user_id(GHIDRA_CAST<Entity_Player *>(player_00));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(uStack_38)) + 0x4))) = (float)(netUserId >> 0x20);
|
|
if (((netUserId != 0xffffffffffffffff) && (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2)) &&
|
|
((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1c030))) == '\0')) {
|
|
cVar4 = FUN_00425a70(netUserId);
|
|
if (cVar4 == '\0') {
|
|
online_stats_add_user(&this->_onlinePlayerStats,GHIDRA_UINT(netUserId),(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(uStack_38))) + 0x4))));
|
|
}
|
|
iVar6 = FUN_00426560(GHIDRA_UINT(netUserId),(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(uStack_38)) + 0x4))));
|
|
if (iVar6 != 0) {
|
|
*GHIDRA_CAST<float *>((iVar6 + 0xc)) = *GHIDRA_CAST<float *>((iVar6 + 0xc)) + 1.0;
|
|
}
|
|
}
|
|
}
|
|
pvVar8 = (this->_playerManager)._playerList._begin;
|
|
playerIdx = playerIdx + 1;
|
|
} while (playerIdx < GHIDRA_UINT((GHIDRA_INT((this->_playerManager)._playerList._end) - GHIDRA_INT(pvVar8) >> 2)));
|
|
}
|
|
game = g_game;
|
|
if (player == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
player = GetPlayer(g_game,0);
|
|
}
|
|
playerManager = &g_game->_playerManager;
|
|
(game->_playerManager)._stageTransitionPlayer = player;
|
|
*GHIDRA_CAST<undefined4 *>(&this->_stageTransition) = 1;
|
|
(this->_stageTransition)._frame = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1ba84))) = isSameStage;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1ba88)))) = transitionOverride;
|
|
playerLocal = PlayerManager::FirstCollectibleOwner(playerManager,0x236,GHIDRA_CAST<RNG **>(playerManager),1);
|
|
game = g_game;
|
|
(this->_stageTransition)._duration = 0x32;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1ba8c))) = playerLocal != GHIDRA_CAST<Entity_Player *>(0x0);
|
|
playerIt = (game->_playerManager)._playerList._begin;
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1ba90)))) = g_vectorZero.x;
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1ba94)))) = g_vectorZero.y;
|
|
if (playerIt != (game->_playerManager)._playerList._end) {
|
|
do {
|
|
playerLocal = GHIDRA_CAST<Entity_Player *>(*playerIt);
|
|
if ((playerLocal != GHIDRA_CAST<Entity_Player *>(0x0)) && (playerLocal->_variant == 0)) {
|
|
(playerLocal->_velocity).x = g_vectorZero.x;
|
|
(playerLocal->_velocity).y = g_vectorZero.y;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(uStack_38)) + 0x0))) = (playerLocal->_velocity).x * 0.1;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(uStack_38)) + 0x4))) = (playerLocal->_velocity).y * 0.1;
|
|
playerLocal->_isControlsEnabled = 0;
|
|
(GHIDRA_CAST<Entity_Player *>((playerLocal)))->Entity_Player::ThrowHeldEntity(GHIDRA_CAST<Vector *>(&uStack_38));
|
|
game = g_game;
|
|
}
|
|
playerIt = playerIt + 1;
|
|
} while (playerIt != (game->_playerManager)._playerList._end);
|
|
}
|
|
iVar6 = game->_stage;
|
|
if (((0 < iVar6) && (iVar6 < 7)) && ((game->_gameStateFlags & 0x1000000000000) != 0)) {
|
|
if ((game->_stageType == 4) || (game->_stageType == 5)) {
|
|
iVar6 = iVar6 + 1;
|
|
}
|
|
if (iVar6 != 1) {
|
|
(this->_stageTransition)._duration = 8;
|
|
goto LAB_006fe0c8;
|
|
}
|
|
}
|
|
if (transitionOverride == 5) {
|
|
iVar6 = (this->_stageTransition)._duration;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1ba8c))) = 0;
|
|
(this->_stageTransition)._frame = iVar6;
|
|
*GHIDRA_CAST<undefined4 *>(&this->_stageTransition) = 2;
|
|
(GHIDRA_CAST<Room *>((game->_room)))->Room::on_leave();
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::SetStage(g_game->_stage,4);
|
|
}
|
|
LAB_006fe0c8:
|
|
this->_isRoomRespawned = 0;
|
|
(GHIDRA_CAST<Room *>((this->_room)))->Room::on_leave();
|
|
pvVar8 = (this->_playerManager)._playerList._end;
|
|
piVar10 = (this->_playerManager)._playerList._begin;
|
|
playerIdx = 0;
|
|
if (GHIDRA_INT(pvVar8) - GHIDRA_INT(piVar10) >> 2 != 0) {
|
|
do {
|
|
uVar5 = playerIdx;
|
|
if (GHIDRA_INT(pvVar8) - GHIDRA_INT(piVar10) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
pvVar8 = (this->_playerManager)._playerList._end;
|
|
}
|
|
playerIt = (this->_playerManager)._playerList._begin;
|
|
if (uVar5 < GHIDRA_UINT((GHIDRA_INT(pvVar8) - GHIDRA_INT(playerIt) >> 2))) {
|
|
playerIt = playerIt + uVar5;
|
|
}
|
|
(GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(*playerIt))))->Entity_Player::room_exit(0);
|
|
while( true ) {
|
|
pvVar8 = (this->_playerManager)._playerList._end;
|
|
piVar10 = (this->_playerManager)._playerList._begin;
|
|
if (GHIDRA_INT(pvVar8) - GHIDRA_INT(piVar10) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
pvVar8 = (this->_playerManager)._playerList._end;
|
|
piVar10 = (this->_playerManager)._playerList._begin;
|
|
}
|
|
uVar11 = GHIDRA_INT(pvVar8) - GHIDRA_INT(piVar10) >> 2;
|
|
piVar9 = piVar10 + uVar5;
|
|
if (uVar11 <= uVar5) {
|
|
piVar9 = piVar10;
|
|
}
|
|
iVar6 = *piVar9;
|
|
pvVar8 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar8) & 0xfffffffcU)) <
|
|
0x1d5) {
|
|
iVar12 = 0;
|
|
}
|
|
else {
|
|
iVar12 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar8) + 0x1d4));
|
|
}
|
|
if (*GHIDRA_CAST<char *>((iVar6 + 0x1519)) != '\0') break;
|
|
piVar9 = *GHIDRA_CAST<int **>((iVar6 + 0x150c));
|
|
while( true ) {
|
|
if (piVar9 == *GHIDRA_CAST<int **>((iVar6 + 0x1510))) goto LAB_006fe1cd;
|
|
if (*piVar9 == iVar12) break;
|
|
piVar9 = piVar9 + 4;
|
|
}
|
|
pvVar8 = (this->_playerManager)._playerList._end;
|
|
if (uVar11 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
pvVar8 = (this->_playerManager)._playerList._end;
|
|
}
|
|
uVar5 = playerIdx;
|
|
piVar10 = (this->_playerManager)._playerList._begin;
|
|
if (playerIdx < GHIDRA_UINT((GHIDRA_INT(pvVar8) - GHIDRA_INT(piVar10) >> 2))) {
|
|
piVar10 = piVar10 + playerIdx;
|
|
}
|
|
pvVar8 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar8) & 0xfffffffcU)) <
|
|
0x1d5) {
|
|
aiStack_24[0] = 0;
|
|
}
|
|
else {
|
|
aiStack_24[0] = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar8) + 0x1d4));
|
|
}
|
|
aiStack_24[1] = 0;
|
|
aiStack_24[2] = *GHIDRA_CAST<undefined4 *>((aiStack_24[0] + 0x78));
|
|
local_18 = GHIDRA_CAST<undefined1 *>(0x0);
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>((*piVar10 + 0x1508)))))->TemporaryEffects::RemoveEffect(aiStack_24,1);
|
|
}
|
|
LAB_006fe1cd:
|
|
pvVar8 = (this->_playerManager)._playerList._end;
|
|
playerIdx = playerIdx + 1;
|
|
} while (playerIdx < uVar11);
|
|
}
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(uStack_38)) + 0x4))) = 2.24208e-44;
|
|
std::set<int>::find_node(aiStack_24 + 1,GHIDRA_INT(&uStack_38) + 4);
|
|
if (((local_18[0xd] == '\0') && (*GHIDRA_CAST<int *>((local_18 + 0x10)) < 0x11)) &&
|
|
(local_18 != (this->_seedEffects)._seedEffects)) {
|
|
this->_stageNameNumeral = this->_stageNameNumeral + 1;
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 006fe2f0
|
|
void Game::ChangeRoom(int roomIdx, int dimension)
|
|
{
|
|
int iVar1;
|
|
undefined4 *playerIt;
|
|
uint i;
|
|
void *room;
|
|
|
|
i = 0;
|
|
room = (this->_playerManager)._playerList._end;
|
|
playerIt = (this->_playerManager)._playerList._begin;
|
|
if (GHIDRA_INT(room) - GHIDRA_INT(playerIt) >> 2 != 0) {
|
|
do {
|
|
if (GHIDRA_INT(room) - GHIDRA_INT(playerIt) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
room = (this->_playerManager)._playerList._end;
|
|
playerIt = (this->_playerManager)._playerList._begin;
|
|
}
|
|
if (i < GHIDRA_UINT((GHIDRA_INT(room) - GHIDRA_INT(playerIt) >> 2))) {
|
|
playerIt = playerIt + i;
|
|
}
|
|
(GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(*playerIt))))->Entity_Player::room_exit(0);
|
|
room = (this->_playerManager)._playerList._end;
|
|
i = i + 1;
|
|
playerIt = (this->_playerManager)._playerList._begin;
|
|
} while (i < GHIDRA_UINT((GHIDRA_INT(room) - GHIDRA_INT(playerIt) >> 2)));
|
|
}
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(this))))->Level::ChangeRoom(roomIdx,dimension);
|
|
(GHIDRA_CAST<Room *>((this->_room)))->Room::Update();
|
|
room = g_game->_room;
|
|
Random();
|
|
iVar1 = ItemPool::get_pool_from_room_entities
|
|
(*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(room) + 8)),*GHIDRA_CAST<RoomDescriptor **>((GHIDRA_CAST<char *>(room) + 4)),
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 0x1bb0)));
|
|
(this->_itemPool)._lastPool = iVar1;
|
|
if (iVar1 == -1) {
|
|
(this->_itemPool)._lastPool = 0;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 006fe3d0
|
|
void Game::MoveToRandomRoom(byte iAmErrorRoom, int Seed, Entity_Player *player)
|
|
{
|
|
int roomIndex;
|
|
int direction;
|
|
int animation;
|
|
int dimension;
|
|
|
|
dimension = -1;
|
|
g_game->_leaveDoor = -1;
|
|
animation = 3;
|
|
direction = -1;
|
|
roomIndex = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(this))))->Level::GetRandomRoomIndex(iAmErrorRoom,Seed);
|
|
StartRoomTransition(this,roomIndex,direction,animation,player,dimension);
|
|
return;
|
|
}
|
|
|
|
// 006fe410
|
|
Entity * Game::SpawnEx(uint type, uint variant, Vector *position, Vector *velocity, Entity *spawner, uint subType, uint seed, uint flags)
|
|
{
|
|
undefined4 uVar1;
|
|
code *pcVar2;
|
|
longlong lVar3;
|
|
longlong lVar4;
|
|
Entity *entity;
|
|
byte bVar5;
|
|
char cVar6;
|
|
EntityRef *ref;
|
|
int iVar7;
|
|
Entity *pEVar8;
|
|
int *piVar9;
|
|
int *piVar10;
|
|
int unusedArg;
|
|
uint unaff_EBX;
|
|
uint uVar11;
|
|
uint uVar12;
|
|
int unaff_ESI;
|
|
float *pfVar13;
|
|
PlayerManager *playerManager;
|
|
uint uVar14;
|
|
bool bVar15;
|
|
float fVar16;
|
|
void *pvVar17;
|
|
float fVar18;
|
|
ulonglong timeNs;
|
|
byte addEnemyKillScore;
|
|
Entity *pEStack_64;
|
|
uint local_60;
|
|
uint local_58;
|
|
Entity *local_54;
|
|
uint local_50;
|
|
float *pfStack_4c;
|
|
Game *local_48;
|
|
EntityRef sourceRef;
|
|
int nextIndex;
|
|
Entity *spawnerEntity;
|
|
EntityPtr *spawnerSlot;
|
|
|
|
spawnerEntity = spawner;
|
|
local_54 = GHIDRA_CAST<Entity *>(type);
|
|
local_48 = this;
|
|
lua_callback_run_pre_entity_spawn
|
|
(GHIDRA_CAST<int *>(&local_54),GHIDRA_CAST<int *>(&variant),position,velocity,spawner,GHIDRA_CAST<int *>(&subType),&seed);
|
|
pEVar8 = local_54;
|
|
type = GHIDRA_UINT(local_54);
|
|
if (1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) {
|
|
(GHIDRA_CAST<ItemPool *>(((g_game->_deathmatchManager)._type)))->ItemPool::ReplaceBlacklistedPickup(&type,&variant,&subType);
|
|
}
|
|
if (((spawnerEntity == GHIDRA_CAST<Entity *>(0x0)) || ((spawnerEntity->_flags & 0x20000000) == 0)) ||
|
|
(pEVar8 != GHIDRA_CAST<Entity *>(0x3e8))) {
|
|
local_60 = variant;
|
|
}
|
|
else {
|
|
local_60 = variant;
|
|
switch(variant) {
|
|
case 0x16:
|
|
local_60 = 0x2e;
|
|
break;
|
|
case 0x17:
|
|
local_60 = 0x35;
|
|
break;
|
|
case 0x18:
|
|
local_60 = 0xcc;
|
|
break;
|
|
case 0x19:
|
|
local_60 = 0x2c;
|
|
break;
|
|
case 0x1a:
|
|
local_60 = 0x2d;
|
|
}
|
|
}
|
|
uVar14 = local_60;
|
|
local_54 = (GHIDRA_CAST<EntityFactory *>((this->_entityFactory)))->EntityFactory::Create(GHIDRA_UINT(pEVar8),(byte)flags & 1);
|
|
if (local_54 == GHIDRA_CAST<Entity *>(0x0)) {
|
|
return GHIDRA_CAST<Entity *>(0x0);
|
|
}
|
|
timeNs = GetTimeNs();
|
|
entity = local_54;
|
|
spawnerEntity = spawner;
|
|
local_50 = GHIDRA_UINT((timeNs >> 0x20));
|
|
lVar3 = (timeNs & 0xffffffff) * 0x431bde82;
|
|
sourceRef._variant = GHIDRA_INT(((ulonglong)lVar3 >> 0x20));
|
|
lVar4 = (ulonglong)local_50 * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20);
|
|
uVar11 = GHIDRA_UINT(((ulonglong)lVar4 >> 0x20));
|
|
lVar3 = (ulonglong)local_50 * 0x431bde82 +
|
|
(ulonglong)
|
|
CONCAT14(CARRY4(uVar11,GHIDRA_UINT((&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<EntityPtr *>(sourceRef._variant)))) + 0x0))) +
|
|
CARRY4(GHIDRA_UINT(lVar3),GHIDRA_UINT(lVar4))))),
|
|
&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<EntityPtr *>(sourceRef._variant)))) + 0x0))) + CARRY4(GHIDRA_UINT(lVar3),GHIDRA_UINT(lVar4)) +
|
|
uVar11);
|
|
sourceRef._spawnerType = GHIDRA_INT(((ulonglong)lVar3 >> 0x20));
|
|
local_58 = GHIDRA_UINT(lVar3) >> 0x12 | sourceRef._spawnerType * 0x4000;
|
|
sourceRef._spawnerType = GHIDRA_UINT(sourceRef._spawnerType) >> 0x12;
|
|
if (spawner == GHIDRA_CAST<Entity *>(0x0)) {
|
|
local_54->_spawnerType = 0;
|
|
iVar7 = 0;
|
|
}
|
|
else {
|
|
local_54->_spawnerType = spawner->_type;
|
|
iVar7 = spawner->_variant;
|
|
}
|
|
spawnerSlot = &local_54->_spawnerEntity;
|
|
local_54->_spawnerVariant = iVar7;
|
|
if (*spawnerSlot != (EntityPtr)0x0) {
|
|
sourceRef._variant = GHIDRA_INT(spawnerSlot);
|
|
std::multiset<unsigned_int>::erase(&sourceRef._variant);
|
|
}
|
|
*spawnerSlot = (EntityPtr)spawnerEntity;
|
|
if (spawnerEntity != GHIDRA_CAST<Entity *>(0x0)) {
|
|
std::multiset<unsigned_int>::insert(spawnerSlot);
|
|
}
|
|
(entity->_pos).x = position->x;
|
|
(entity->_pos).y = position->y;
|
|
(entity->_velocity).x = velocity->x;
|
|
(entity->_velocity).y = velocity->y;
|
|
entity->Init(pEVar8,local_60,subType,seed);
|
|
iVar7 = *GHIDRA_CAST<int *>((local_58 + 0x18300));
|
|
nextIndex = *GHIDRA_CAST<int *>((iVar7 + 0x1214));
|
|
*GHIDRA_CAST<int *>((iVar7 + 0x1214)) = nextIndex + 1;
|
|
entity->_index = nextIndex;
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>((iVar7 + 0x1218)))))->EntityList::AddEntity(entity);
|
|
if ((spawnerEntity != GHIDRA_CAST<Entity *>(0x0)) &&
|
|
(bVar5 = (GHIDRA_CAST<Entity *>((spawnerEntity)))->Entity::IsActiveEnemy(1), bVar5 != 0)) {
|
|
if ((spawnerEntity->_flags & 0x1000000000000000) == 0) {
|
|
bVar5 = (GHIDRA_CAST<Entity *>((spawnerEntity)))->Entity::HasEntityFlags(0x20000000);
|
|
if (bVar5 != 0) {
|
|
addEnemyKillScore = 0;
|
|
bVar5 = 0;
|
|
iVar7 = -1;
|
|
ref = (GHIDRA_CAST<EntityRef *>((&sourceRef)))->EntityRef::EntityRef();
|
|
(GHIDRA_CAST<Entity *>((entity)))->Entity::AddCharmed(ref,iVar7,bVar5,addEnemyKillScore);
|
|
}
|
|
}
|
|
else {
|
|
uVar11 = *GHIDRA_CAST<uint *>((GHIDRA_INT(&entity->_flags) + 4));
|
|
uVar1 = (undefined4)entity->_flags;
|
|
*GHIDRA_CAST<undefined4 *>(&entity->_flags) = uVar1;
|
|
*GHIDRA_CAST<uint *>((GHIDRA_INT(&entity->_flags) + 4)) = uVar11 | 0x10000000;
|
|
if ((unaff_ESI != 9) && (unaff_ESI != 7)) {
|
|
*GHIDRA_CAST<undefined4 *>(&entity->_flags) = uVar1;
|
|
*GHIDRA_CAST<uint *>((GHIDRA_INT(&entity->_flags) + 4)) = uVar11 | 0x10000020;
|
|
}
|
|
sourceRef._entity = (spawnerEntity->_charmSource)._entity;
|
|
if (sourceRef._entity == (void *)0x0) {
|
|
sourceRef._type = 0;
|
|
sourceRef._variant = 0;
|
|
sourceRef._spawnerType = 0;
|
|
sourceRef._spawnerVariant = 0;
|
|
sourceRef._position.x = g_vectorZero.x;
|
|
sourceRef._position.y = g_vectorZero.y;
|
|
sourceRef._velocity.x = g_vectorZero.x;
|
|
sourceRef._velocity.y = g_vectorZero.y;
|
|
LAB_006fe765:
|
|
sourceRef._flags = 0;
|
|
if (sourceRef._entity != (void *)0x0) goto LAB_006fe771;
|
|
sourceRef._flags = 0;
|
|
LAB_006fe793:
|
|
local_60 = 0;
|
|
if (sourceRef._entity != (void *)0x0) goto LAB_006fe79f;
|
|
LAB_006fe7b8:
|
|
uVar11 = 0;
|
|
}
|
|
else {
|
|
sourceRef._type = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(sourceRef._entity) + 0x28));
|
|
sourceRef._position.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(sourceRef._entity) + 0x33c));
|
|
sourceRef._position.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(sourceRef._entity) + 0x340));
|
|
sourceRef._variant = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(sourceRef._entity) + 0x2c));
|
|
sourceRef._spawnerType = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(sourceRef._entity) + 0x34));
|
|
sourceRef._spawnerVariant = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(sourceRef._entity) + 0x38));
|
|
sourceRef._velocity.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(sourceRef._entity) + 0x360));
|
|
sourceRef._velocity.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(sourceRef._entity) + 0x364));
|
|
if ((*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(sourceRef._entity) + 0x168)) & 0x100) == 0) goto LAB_006fe765;
|
|
sourceRef._flags = 1;
|
|
LAB_006fe771:
|
|
if ((*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(sourceRef._entity) + 0x168)) & 0x20000000) == 0) goto LAB_006fe793;
|
|
local_60 = 2;
|
|
LAB_006fe79f:
|
|
if ((*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(sourceRef._entity) + 0x16c)) & 0x400000) == 0) goto LAB_006fe7b8;
|
|
uVar11 = 4;
|
|
}
|
|
sourceRef._flags = uVar11 | local_60 | sourceRef._flags;
|
|
(GHIDRA_CAST<Entity *>((entity)))->Entity::AddCharmed(&sourceRef,-1,0,0);
|
|
if (unaff_ESI - 10U < 0x3de) {
|
|
ANM2::LoadDeliriumForm(&entity->_sprite,unaff_ESI,uVar14,1);
|
|
}
|
|
}
|
|
iVar7 = __RTDynamicCast(spawnerEntity,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0);
|
|
pEVar8 = (Entity *)
|
|
__RTDynamicCast(entity,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0);
|
|
if ((iVar7 != 0) && (pEVar8 != GHIDRA_CAST<Entity *>(0x0))) {
|
|
bVar5 = (GHIDRA_CAST<Entity *>((pEVar8)))->Entity::HasEntityFlags(1);
|
|
if (bVar5 == 0) {
|
|
bVar5 = (GHIDRA_CAST<Entity *>((spawnerEntity)))->Entity::HasEntityFlags(0x100000000000000);
|
|
if (bVar5 != 0) {
|
|
sourceRef._type = 0;
|
|
sourceRef._variant = 0;
|
|
sourceRef._spawnerType = 0;
|
|
sourceRef._spawnerVariant = 0;
|
|
sourceRef._position.x = g_vectorZero.x;
|
|
sourceRef._position.y = g_vectorZero.y;
|
|
sourceRef._velocity.x = g_vectorZero.x;
|
|
sourceRef._velocity.y = g_vectorZero.y;
|
|
sourceRef._flags = 0;
|
|
sourceRef._entity = (void *)0x0;
|
|
(GHIDRA_CAST<Entity *>((pEVar8)))->Entity::AddBrimstoneMark(&sourceRef,0x5a);
|
|
}
|
|
bVar5 = (GHIDRA_CAST<Entity *>((spawnerEntity)))->Entity::HasEntityFlags(0x1000000);
|
|
if (bVar5 != 0) {
|
|
sourceRef._type = 0;
|
|
sourceRef._variant = 0;
|
|
sourceRef._spawnerType = 0;
|
|
sourceRef._spawnerVariant = 0;
|
|
sourceRef._position.x = g_vectorZero.x;
|
|
sourceRef._position.y = g_vectorZero.y;
|
|
sourceRef._velocity.x = g_vectorZero.x;
|
|
sourceRef._velocity.y = g_vectorZero.y;
|
|
sourceRef._flags = 0;
|
|
sourceRef._entity = (void *)0x0;
|
|
(GHIDRA_CAST<Entity *>((pEVar8)))->Entity::AddShrink(&sourceRef,0x5a,0,0);
|
|
if (0 < pEVar8->_shrinkCountdown) {
|
|
uVar1 = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&pEVar8->_flags) + 4));
|
|
*GHIDRA_CAST<uint *>(&pEVar8->_flags) = GHIDRA_UINT(pEVar8->_flags) | 0x1000000;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&pEVar8->_flags) + 4)) = uVar1;
|
|
pEVar8->_shrinkStatus1 = pEVar8->_shrinkStatus2;
|
|
}
|
|
}
|
|
}
|
|
pvVar17 = (void *)(*GHIDRA_CAST<float *>((iVar7 + 0xf48)) * (float)pEVar8[3]._damageEvents._begin);
|
|
pcVar2 = *(code **)(*GHIDRA_CAST<int *>(pEVar8) + 0x4c);
|
|
pEVar8[3]._damageEvents._begin = pvVar17;
|
|
fVar18 = (float)pvVar17 * pEVar8->_shrinkStatus1;
|
|
fVar16 = fVar18 * g_vectorOne.x;
|
|
(pEVar8->_sprite)._scale.y = fVar18 * g_vectorOne.y;
|
|
(pEVar8->_sprite)._scale.x = fVar16;
|
|
pEVar8[3]._pausePosition.y = pEVar8[3]._pausePosition.y * *GHIDRA_CAST<float *>((iVar7 + 0xf48));
|
|
pEVar8[3]._pausePosition.x = pEVar8[3]._pausePosition.x * *GHIDRA_CAST<float *>((iVar7 + 0xf44));
|
|
pEVar8->_maxHitPoints = pEVar8->_maxHitPoints * *GHIDRA_CAST<float *>((iVar7 + 0xf44));
|
|
pEVar8->_health = pEVar8->_health * *GHIDRA_CAST<float *>((iVar7 + 0xf44));
|
|
cVar6 = (*pcVar2)();
|
|
if (cVar6 != '\0') {
|
|
fVar16 = *GHIDRA_CAST<float *>((iVar7 + 0xf54));
|
|
pfVar13 = &pEVar8[3]._burnTickDamage;
|
|
if (*pfVar13 != fVar16) {
|
|
if (*pfVar13 != 0.0) {
|
|
pfStack_4c = pfVar13;
|
|
std::multiset<unsigned_int>::erase(&pfStack_4c);
|
|
}
|
|
*pfVar13 = fVar16;
|
|
if (fVar16 != 0.0) {
|
|
std::multiset<unsigned_int>::insert(pfVar13);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
bVar5 = ShouldEraseEnemy(entity);
|
|
if (bVar5 != 0) {
|
|
Entity::RemoveWithPoof(entity,unusedArg);
|
|
}
|
|
if ((entity->_exists != 0) && (*GHIDRA_CAST<int *>((local_58 + 0x67758)) != *GHIDRA_CAST<int *>((local_58 + 0x6775c)))) {
|
|
local_54 = GHIDRA_CAST<Entity *>(entity->_variant);
|
|
piVar10 = GHIDRA_CAST<int *>((local_58 + 0x67780));
|
|
uVar14 = entity->_type;
|
|
local_58 = uVar14;
|
|
std::map<unsigned_long_long>::find(&pfStack_4c,&local_58);
|
|
if (pfStack_4c == GHIDRA_CAST<float *>(*piVar10)) {
|
|
local_54 = GHIDRA_CAST<Entity *>(0xffffffff);
|
|
local_58 = uVar14;
|
|
piVar9 = GHIDRA_CAST<int *>(std)::map<unsigned_long_long>::find(&pfStack_4c,&local_58);
|
|
if (*piVar9 == *piVar10) goto LAB_006feb8d;
|
|
}
|
|
uVar14 = 0;
|
|
playerManager = &g_game->_playerManager;
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) - GHIDRA_INT((playerManager->_playerList)._begin) >>
|
|
2 != 0) {
|
|
do {
|
|
pvVar17 = (playerManager->_playerList)._end;
|
|
if (GHIDRA_INT(pvVar17) - GHIDRA_INT((playerManager->_playerList)._begin) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
pvVar17 = (playerManager->_playerList)._end;
|
|
}
|
|
piVar10 = (playerManager->_playerList)._begin;
|
|
if (uVar14 < GHIDRA_UINT((GHIDRA_INT(pvVar17) - GHIDRA_INT(piVar10) >> 2))) {
|
|
piVar10 = piVar10 + uVar14;
|
|
}
|
|
trigger_set_dispatch((void *)(*piVar10 + 0x1fc8),6,entity,position,velocity);
|
|
uVar14 = uVar14 + 1;
|
|
playerManager = &g_game->_playerManager;
|
|
} while (uVar14 < GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((playerManager->_playerList)._begin) >> 2)));
|
|
}
|
|
}
|
|
LAB_006feb8d:
|
|
timeNs = GetTimeNs();
|
|
uVar11 = GHIDRA_UINT((timeNs >> 0x20));
|
|
lVar3 = (timeNs & 0xffffffff) * 0x431bde82;
|
|
lVar4 = (ulonglong)uVar11 * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20);
|
|
uVar12 = GHIDRA_UINT(((ulonglong)lVar4 >> 0x20));
|
|
uVar14 = GHIDRA_INT(((ulonglong)lVar3 >> 0x20)) + GHIDRA_UINT(CARRY4(GHIDRA_UINT(lVar3),GHIDRA_UINT(lVar4)));
|
|
lVar3 = (ulonglong)uVar11 * 0x431bde82 +
|
|
(ulonglong)CONCAT14(CARRY4(uVar12,uVar14),uVar12 + uVar14);
|
|
uVar12 = GHIDRA_UINT(((ulonglong)lVar3 >> 0x20));
|
|
uVar14 = GHIDRA_UINT(lVar3) >> 0x12 | uVar12 * 0x4000;
|
|
uVar11 = uVar14 - unaff_EBX;
|
|
bVar15 = CARRY4(GHIDRA_UINT(g_entitySpawnTimeMs),uVar11);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_entitySpawnTimeMs)) + 0x0))) = GHIDRA_UINT(g_entitySpawnTimeMs) + uVar11;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_entitySpawnTimeMs)) + 0x4))) =
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(g_entitySpawnTimeMs)) + 0x4))) + (((uVar12 >> 0x12) - GHIDRA_INT(local_48)) - GHIDRA_UINT((uVar14 < unaff_EBX)))
|
|
+ GHIDRA_UINT(bVar15);
|
|
return pEStack_64;
|
|
}
|
|
|
|
// 006fece0
|
|
Entity_NPC * Game::SpawnEntityDesc(EntityDesc *desc, Vector *position, Entity *spawner)
|
|
{
|
|
uint seed;
|
|
Entity *spawned;
|
|
Entity_NPC *npc;
|
|
undefined4 uVar1;
|
|
TypeDescriptor *pTVar2;
|
|
TypeDescriptor *pTVar3;
|
|
undefined4 uVar4;
|
|
|
|
seed = Random();
|
|
uVar4 = 0;
|
|
pTVar3 = &IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor;
|
|
pTVar2 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
uVar1 = 0;
|
|
spawned = Spawn(g_game,desc->_type,desc->_variant,position,&g_vectorZero,spawner,desc->_subtype,
|
|
seed);
|
|
npc = GHIDRA_CAST<Entity_NPC *>(__RTDynamicCast(spawned,uVar1,pTVar2,pTVar3,uVar4));
|
|
if (npc != GHIDRA_CAST<Entity_NPC *>(0x0)) {
|
|
npc->_health = desc->_health;
|
|
npc->_maxHitPoints = desc->_maxHealth;
|
|
(GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::Morph(desc->_type,desc->_variant,desc->_subtype,desc->_championId);
|
|
}
|
|
return npc;
|
|
}
|
|
|
|
// 006fed60
|
|
void Game::DamageRadius(Vector *position, Entity *source, ulonglong damageFlags, byte isDamagePlayers, int unused, float playerDamageThreshold, BitSet128 tearFlags, float damage, float radius)
|
|
{
|
|
BitSet128 flags;
|
|
qword qVar1;
|
|
bool isPlayerSource;
|
|
byte isPoisonImmune;
|
|
uint uVar3;
|
|
BitSet128 *poisonBits;
|
|
qword *allocCounter;
|
|
float playerDamage;
|
|
EntityRef sourceRef;
|
|
BitSet128 local_50;
|
|
EntityList_EL hits;
|
|
uint local_2c;
|
|
float enemyDamage;
|
|
char isDamageEnemies;
|
|
byte isHitPlayers;
|
|
undefined1 *puStack_20;
|
|
void *local_1c;
|
|
undefined1 *puStack_18;
|
|
undefined4 local_14;
|
|
Game *game;
|
|
bool isPlayerSource;
|
|
Entity_Player *target;
|
|
int targetType;
|
|
|
|
game = g_game;
|
|
puStack_20 = GHIDRA_CAST<undefined1 *>((GHIDRA_INT(register0x00000010) + -4));
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00afc22d;
|
|
local_1c = ExceptionList;
|
|
uVar3 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 0x10U;
|
|
ExceptionList = &local_1c;
|
|
enemyDamage = damage;
|
|
(GHIDRA_CAST<EntityRef *>((&sourceRef)))->EntityRef::constructor(source);
|
|
if ((source == GHIDRA_CAST<Entity *>(0x0)) ||
|
|
((source->_type != 1 && ((source->_type != 3 || ((source->_flags & 0x100) != 0)))))) {
|
|
isPlayerSource = false;
|
|
if (source != GHIDRA_CAST<Entity *>(0x0)) {
|
|
if ((source->_flags & 0x20000000) != 0) {
|
|
isPlayerSource = false;
|
|
isHitPlayers = 0;
|
|
goto LAB_006fee08;
|
|
}
|
|
isPlayerSource = false;
|
|
}
|
|
LAB_006fee00:
|
|
isPlayerSource = isPlayerSource;
|
|
isHitPlayers = 1;
|
|
if (source != GHIDRA_CAST<Entity *>(0x0)) goto LAB_006fee08;
|
|
LAB_006fee31:
|
|
isDamageEnemies = '\0';
|
|
if (isDamagePlayers == 0) goto LAB_006fee3d;
|
|
}
|
|
else {
|
|
isPlayerSource = true;
|
|
isPlayerSource = true;
|
|
if (isDamagePlayers != 0) goto LAB_006fee00;
|
|
isHitPlayers = isDamagePlayers;
|
|
LAB_006fee08:
|
|
if (!isPlayerSource) {
|
|
local_2c = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&source->_flags) + 4));
|
|
if (((source->_flags & 0x100) == 0) && ((source->_flags & 0x20000100) == 0))
|
|
goto LAB_006fee31;
|
|
}
|
|
}
|
|
isDamageEnemies = '\x01';
|
|
LAB_006fee3d:
|
|
EntityList::QueryRadius
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(game->_room) + 0x1218)),&hits,position,radius,0xffffffff);
|
|
local_14 = 0;
|
|
local_2c = 0;
|
|
if (hits._size != 0) {
|
|
do {
|
|
target = *GHIDRA_CAST<Entity_Player **>((GHIDRA_CAST<char *>(hits._data) + local_2c * 4));
|
|
if (target->_entityCollisionClass != 0) {
|
|
targetType = target->_type;
|
|
if (((targetType == 1) || (targetType == 3)) && (isHitPlayers != 0)) {
|
|
poisonBits = BitSet128::operator_and(&local_50,&tearFlags,&g_tearFlagPoison);
|
|
if (((GHIDRA_INT(poisonBits->_l) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&poisonBits->_l) + 4)) != 0) ||
|
|
(GHIDRA_INT(poisonBits->_h) != 0 || *GHIDRA_CAST<int *>((GHIDRA_INT(&poisonBits->_h) + 4)) != 0)) &&
|
|
(targetType == 1)) {
|
|
isPoisonImmune = (GHIDRA_CAST<Entity_Player *>((target)))->Entity_Player::HasPoisonImmunity();
|
|
if (isPoisonImmune != 0) goto LAB_006fef6e;
|
|
}
|
|
if (enemyDamage < playerDamageThreshold) {
|
|
playerDamage = 1.0;
|
|
}
|
|
else {
|
|
playerDamage = 2.0;
|
|
}
|
|
target->TakeDamage(playerDamage,damageFlags,&sourceRef,0x1e);
|
|
}
|
|
else if ((((1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) && (targetType == 1)) ||
|
|
(targetType - 10U < 0x3de)) && ((isDamageEnemies != '\0' && (targetType != 1)))) {
|
|
target->TakeDamage(enemyDamage,damageFlags,&sourceRef,0x1e,uVar3);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags._l)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlags._l)) + 0x4)));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags._l)) + 0x0))) = (undefined4)tearFlags._l;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags._h)) + 0x0))) = (undefined4)tearFlags._h;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(flags._h)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlags._h)) + 0x4)));
|
|
Entity_Tear::ApplyTearFlagEffects(GHIDRA_CAST<Entity *>(target),position,flags,source,3.5);
|
|
}
|
|
}
|
|
LAB_006fef6e:
|
|
local_2c = local_2c + 1;
|
|
} while (local_2c < GHIDRA_UINT(hits._size));
|
|
}
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(hits)) + 0x0))) == '\0') {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocCounter = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocCounter = GHIDRA_CAST<qword *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
if (hits._data != (void *)0x0) {
|
|
uVar3 = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(hits._data) + -4));
|
|
qVar1 = *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(qVar1) < uVar3));
|
|
free((void *)(GHIDRA_INT(hits._data) + -4));
|
|
}
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 006ff2a0
|
|
void Game::BombDamage(Vector *pos, float damage, float radius, byte lineCheck, Entity *source, BitSet128 tearFlags, ulonglong damageFlags, byte damageSource)
|
|
{
|
|
EntityRef source_00;
|
|
undefined1 *puVar1;
|
|
byte bVar2;
|
|
char cVar3;
|
|
Entity *pEVar4;
|
|
int iVar5;
|
|
BitSet128 *maskedFlags;
|
|
uint uVar6;
|
|
Vector *vecResult;
|
|
float fVar7;
|
|
Entity **clampedValue;
|
|
GridEntity *pGVar8;
|
|
Entity_Player *player;
|
|
GridEntity *pit;
|
|
int gridX;
|
|
int *piVar9;
|
|
Vector *player;
|
|
byte prevHitCount;
|
|
Entity *pEVar10;
|
|
float fVar11;
|
|
Room *pRVar12;
|
|
float fVar13;
|
|
float fVar14;
|
|
double dVar15;
|
|
undefined1 auStackY_1f4 [128];
|
|
BitSet128 nonExplosiveFlags2;
|
|
BitSet128 notExplosiveMask2;
|
|
BitSet128 nonExplosiveFlags;
|
|
BitSet128 notExplosiveMask;
|
|
BitSet128 crossBombMask;
|
|
BitSet128 knockbackMask;
|
|
EntityRef sourceRef;
|
|
EntityRef playerDamageSource;
|
|
Vector local_90;
|
|
EntityList_EL nearby;
|
|
BitSet128 local_78;
|
|
Vector local_68;
|
|
int *hitGridSet;
|
|
Vector local_58;
|
|
Vector local_50;
|
|
Game *savedGame;
|
|
float effectiveRadius;
|
|
GridEntity *local_40;
|
|
int *local_3c;
|
|
Entity *local_38;
|
|
Entity *local_34;
|
|
Room *local_30;
|
|
byte isPlayerSource;
|
|
Entity *local_28;
|
|
float local_24;
|
|
undefined1 *puStack_20;
|
|
void *local_1c;
|
|
undefined1 *puStack_18;
|
|
int local_14;
|
|
int gridWidth;
|
|
void *room;
|
|
code *takeDamageFn;
|
|
|
|
puStack_20 = GHIDRA_CAST<undefined1 *>((GHIDRA_INT(register0x00000010) + -4));
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00afc2b9;
|
|
local_1c = ExceptionList;
|
|
ExceptionList = &local_1c;
|
|
savedGame = this;
|
|
puVar1 = GHIDRA_CAST<undefined1 *>((GHIDRA_INT(register0x00000010) + -4));
|
|
if (source == GHIDRA_CAST<Entity *>(0x0)) {
|
|
LAB_006ff2fb:
|
|
puStack_20 = puVar1;
|
|
iVar5 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::GetTrinketMultiplier(0x3f);
|
|
if (iVar5 == 2) {
|
|
radius = radius * 0.75;
|
|
}
|
|
else {
|
|
puVar1 = puStack_20;
|
|
if (iVar5 < 3) goto LAB_006ff333;
|
|
radius = radius * 0.5;
|
|
}
|
|
}
|
|
else {
|
|
puVar1 = GHIDRA_CAST<undefined1 *>((GHIDRA_INT(register0x00000010) + -4));
|
|
if (source->_type != 1) {
|
|
pEVar4 = (GHIDRA_CAST<Entity *>((source)))->Entity::GetPlayerAncestor();
|
|
puVar1 = puStack_20;
|
|
if (pEVar4 == GHIDRA_CAST<Entity *>(0x0)) goto LAB_006ff2fb;
|
|
}
|
|
LAB_006ff333:
|
|
puStack_20 = puVar1;
|
|
}
|
|
effectiveRadius = radius;
|
|
if (damage < 166.0) {
|
|
fVar7 = damage;
|
|
maskedFlags = BitSet128::operator_and(&local_78,&tearFlags,&g_tearFlagCrossBomb);
|
|
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)) || (fVar7 < 125.0))
|
|
goto LAB_006ff38e;
|
|
}
|
|
uVar6 = Random();
|
|
ShakeScreen(this,uVar6 % 7 + 7);
|
|
LAB_006ff38e:
|
|
if (((source == GHIDRA_CAST<Entity *>(0x0)) || (source->_type != 1)) || (isPlayerSource = 1, damageSource != 0)
|
|
) {
|
|
isPlayerSource = 0;
|
|
}
|
|
EntityList::QueryRadius
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(this->_room) + 0x1218)),&nearby,pos,effectiveRadius,0xffffffff);
|
|
local_14 = 0;
|
|
local_40 = GHIDRA_CAST<GridEntity *>(0x0);
|
|
if (nearby._size != 0) {
|
|
do {
|
|
pEVar4 = *GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(nearby._data) + GHIDRA_INT(local_40) * 4));
|
|
local_28 = pEVar4;
|
|
if ((((pEVar4 != source) || (damageSource != 0)) &&
|
|
((pEVar4->_dead == 0 &&
|
|
((((pEVar4->_entityCollisionClass != 0 && (pEVar4->_entityGridCollisionClass != 4)) &&
|
|
(pEVar4->_mass != 0.0)) && ((iVar5 = pEVar4->_type, iVar5 != 2 && (iVar5 != 9))))))))
|
|
&& (((source == GHIDRA_CAST<Entity *>(0x0) || ((iVar5 != 0x112 || (source->_type != 0x112)))) ||
|
|
(g_game->_challenge == 0x17)))) {
|
|
local_38 = GHIDRA_CAST<Entity *>((effectiveRadius + pEVar4->_size));
|
|
local_30 = GHIDRA_CAST<Room *>(((pEVar4->_pos).x - pos->x));
|
|
local_24 = (pEVar4->_pos).y - pos->y;
|
|
local_3c = GHIDRA_CAST<int *>(sqrtf((float)local_30 * (float)local_30 + local_24 * local_24));
|
|
if (lineCheck != 0) {
|
|
local_50.y = (pEVar4->_pos).y;
|
|
local_50.x = (pEVar4->_pos).x;
|
|
bVar2 = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::CheckLine(pos,&local_50,2,0,1,0,GHIDRA_CAST<Vector *>(0x0));
|
|
if (bVar2 == 0) goto LAB_006ffd46;
|
|
}
|
|
if ((source != GHIDRA_CAST<Entity *>(0x0)) && (source->_type == 4)) {
|
|
iVar5 = __RTDynamicCast();
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlags._l)) + 0x0))) = GHIDRA_UINT(tearFlags._l) | *GHIDRA_CAST<uint *>((iVar5 + 0x438));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlags._l)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlags._l)) + 0x4))) | *GHIDRA_CAST<uint *>((iVar5 + 0x43c));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlags._h)) + 0x0))) = GHIDRA_UINT(tearFlags._h) | *GHIDRA_CAST<uint *>((iVar5 + 0x440));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlags._h)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlags._h)) + 0x4))) | *GHIDRA_CAST<uint *>((iVar5 + 0x444));
|
|
}
|
|
if ((0.0 < (float)local_3c) && (pEVar4->_type != 1000)) {
|
|
iVar5 = __RTDynamicCast();
|
|
if (((pEVar4->_flags & 0x4000000) == 0) &&
|
|
((pEVar4->_type != 1 ||
|
|
((((iVar5 == 0 || (*GHIDRA_CAST<float *>((iVar5 + 0x37c)) != 1000.0)) &&
|
|
((source == GHIDRA_CAST<Entity *>(0x0) || ((source->_flags & 0x20000000) == 0)))) &&
|
|
(isPlayerSource == 0)))))) {
|
|
fVar7 = pEVar4->_mass;
|
|
local_38 = GHIDRA_CAST<Entity *>(((float)local_38 - (float)local_3c));
|
|
local_34 = GHIDRA_CAST<Entity *>(0x41700000);
|
|
clampedValue = &local_34;
|
|
if ((float)local_38 <= 15.0) {
|
|
clampedValue = &local_38;
|
|
}
|
|
pEVar10 = *clampedValue;
|
|
if (fVar7 <= 20.0) {
|
|
if (fVar7 <= 30.0) {
|
|
if (fVar7 <= 50.0) {
|
|
if (150.0 < fVar7) {
|
|
pEVar10 = GHIDRA_CAST<Entity *>(((float)pEVar10 * 0.005));
|
|
}
|
|
}
|
|
else {
|
|
pEVar10 = GHIDRA_CAST<Entity *>(((float)pEVar10 * 0.015));
|
|
}
|
|
}
|
|
else {
|
|
pEVar10 = GHIDRA_CAST<Entity *>(((float)pEVar10 * 0.2));
|
|
}
|
|
}
|
|
else {
|
|
pEVar10 = GHIDRA_CAST<Entity *>(((float)pEVar10 * 0.5));
|
|
}
|
|
fVar7 = 0.5;
|
|
piVar9 = local_3c;
|
|
maskedFlags = BitSet128::operator_and(&knockbackMask,&tearFlags,&g_tearFlagKnockback);
|
|
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)) {
|
|
iVar5 = pEVar4->_type;
|
|
LAB_006ff827:
|
|
fVar14 = (pEVar4->_velocity).x;
|
|
fVar11 = ((float)local_30 / (float)piVar9) * (float)pEVar10;
|
|
fVar13 = (local_24 / (float)piVar9) * (float)pEVar10;
|
|
if (iVar5 != 1) goto LAB_006ff6ce;
|
|
local_34 = GHIDRA_CAST<Entity *>(0x41200000);
|
|
local_30 = GHIDRA_CAST<Room *>((fVar11 + fVar14 * fVar7));
|
|
local_24 = fVar13 + (pEVar4->_velocity).y * fVar7;
|
|
local_38 = GHIDRA_CAST<Entity *>(sqrtf((float)local_30 * (float)local_30 + local_24 * local_24));
|
|
clampedValue = &local_34;
|
|
if ((float)local_38 <= 10.0) {
|
|
clampedValue = &local_38;
|
|
}
|
|
if ((float)local_38 <= 0.0) {
|
|
fVar13 = local_24;
|
|
pRVar12 = local_30;
|
|
}
|
|
else {
|
|
fVar13 = local_24 * ((float)*clampedValue / (float)local_38);
|
|
pRVar12 = GHIDRA_CAST<Room *>(((float)local_30 * ((float)*clampedValue / (float)local_38)));
|
|
}
|
|
}
|
|
else {
|
|
iVar5 = 1;
|
|
if (pEVar4->_type == 1) goto LAB_006ff827;
|
|
fVar14 = (pEVar4->_velocity).x;
|
|
fVar11 = ((float)local_30 / (float)piVar9) * ((float)pEVar10 + (float)pEVar10);
|
|
fVar13 = (local_24 / (float)piVar9) * ((float)pEVar10 + (float)pEVar10);
|
|
LAB_006ff6ce:
|
|
fVar13 = fVar13 + (pEVar4->_velocity).y * fVar7;
|
|
pRVar12 = GHIDRA_CAST<Room *>((fVar11 + fVar14 * fVar7));
|
|
}
|
|
(pEVar4->_velocity).y = fVar13;
|
|
(pEVar4->_velocity).x = (float)pRVar12;
|
|
}
|
|
}
|
|
iVar5 = pEVar4->_type;
|
|
if ((iVar5 == 1) || (iVar5 == 3)) {
|
|
if (0.0 < damage) {
|
|
fVar7 = damage;
|
|
(GHIDRA_CAST<EntityRef *>((&playerDamageSource)))->EntityRef::constructor(source);
|
|
playerDamageSource._flags = playerDamageSource._flags | GHIDRA_UINT(isPlayerSource) * 2;
|
|
if (fVar7 < 85.0) {
|
|
local_24 = 1.0;
|
|
}
|
|
else {
|
|
local_24 = 2.0;
|
|
}
|
|
if ((damageFlags & 0x10000000) != 0) {
|
|
local_24 = 1.0;
|
|
}
|
|
if (1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) {
|
|
local_24 = fVar7 * 0.2;
|
|
}
|
|
if (pEVar4->_type == 1) {
|
|
player = GHIDRA_CAST<Entity_Player *>(__RTDynamicCast());
|
|
source_00._variant = playerDamageSource._variant;
|
|
source_00._type = playerDamageSource._type;
|
|
source_00._spawnerType = playerDamageSource._spawnerType;
|
|
source_00._spawnerVariant = playerDamageSource._spawnerVariant;
|
|
source_00._position.x = playerDamageSource._position.x;
|
|
source_00._position.y = playerDamageSource._position.y;
|
|
source_00._velocity.x = playerDamageSource._velocity.x;
|
|
source_00._velocity.y = playerDamageSource._velocity.y;
|
|
source_00._flags = playerDamageSource._flags;
|
|
source_00._entity = playerDamageSource._entity;
|
|
bVar2 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::is_evil_charm_immune(source_00);
|
|
if (bVar2 != 0) goto LAB_006ffd46;
|
|
}
|
|
pEVar4->TakeDamage();
|
|
}
|
|
}
|
|
else if (iVar5 == 1000) {
|
|
iVar5 = pEVar4->_variant;
|
|
if ((((iVar5 == 0x15) || (iVar5 == 0x21)) || (iVar5 == 0x3f)) ||
|
|
(((iVar5 == 0x40 || (iVar5 == 0x9f)) || (iVar5 == 0x9e)))) {
|
|
pEVar4->_dead = 1;
|
|
goto LAB_006ffd46;
|
|
}
|
|
if (iVar5 != 0x4a) goto LAB_006ffac3;
|
|
if (pEVar4->_subtype != 0) goto LAB_006ffd46;
|
|
local_30 = g_game->_room;
|
|
if (local_30->_roomType == 0x12) {
|
|
local_34 = GHIDRA_CAST<Entity *>(Random());
|
|
room = g_game->_room;
|
|
vecResult = Room::GetCenterPos(&local_68);
|
|
gridX = GHIDRA_INT(((vecResult->x - 40.0) / 40.0 + 0.5));
|
|
iVar5 = GHIDRA_INT(((vecResult->y - 120.0) / 40.0 + 0.5));
|
|
if (((gridX < 0) || (gridWidth = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 0xc)), gridWidth <= gridX)) ||
|
|
((iVar5 < 0 || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 0x10)) <= iVar5)))) {
|
|
local_24 = -NAN;
|
|
LAB_006ff8e1:
|
|
fVar7 = local_24;
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("SpawnGridEntity: Grid index invalid\n"));
|
|
}
|
|
else {
|
|
fVar7 = (float)(iVar5 * gridWidth + gridX);
|
|
local_24 = fVar7;
|
|
if ((GHIDRA_INT(fVar7) < 0) || (0x1bf < GHIDRA_INT(fVar7))) goto LAB_006ff8e1;
|
|
}
|
|
if (GHIDRA_UINT(fVar7) < 0x1c0) {
|
|
uVar6 = (GHIDRA_CAST<Room *>((local_30)))->Room::GetGridCollision(GHIDRA_INT(fVar7));
|
|
if (GHIDRA_INT(uVar6) < 1) {
|
|
pGVar8 = operator_new(0x154);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x12;
|
|
local_90.y = (float)pGVar8;
|
|
if (pGVar8 == GHIDRA_CAST<GridEntity *>(0x0)) {
|
|
pGVar8 = GHIDRA_CAST<GridEntity *>(0x0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<GridEntity *>((pGVar8)))->GridEntity::GridEntity();
|
|
*GHIDRA_CAST<undefined ***>(pGVar8) = IsaacRepentancePlus::GridEntity_Stairs::vftable;
|
|
}
|
|
local_14 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8;
|
|
if (pGVar8 != GHIDRA_CAST<GridEntity *>(0x0)) {
|
|
(pGVar8->_desc)._type = 0x12;
|
|
goto LAB_006ffa6f;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
bVar2 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::CanSpawnTrapDoor();
|
|
if (bVar2 != 0) {
|
|
local_30 = g_game->_room;
|
|
local_34 = GHIDRA_CAST<Entity *>(Random());
|
|
room = g_game->_room;
|
|
vecResult = Room::GetCenterPos(GHIDRA_CAST<Vector *>(&local_78._h));
|
|
gridX = GHIDRA_INT(((vecResult->x - 40.0) / 40.0 + 0.5));
|
|
iVar5 = GHIDRA_INT(((vecResult->y - 120.0) / 40.0 + 0.5));
|
|
if ((((gridX < 0) || (gridWidth = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 0xc)), gridWidth <= gridX)) ||
|
|
(iVar5 < 0)) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 0x10)) <= iVar5)) {
|
|
local_24 = -NAN;
|
|
LAB_006ff9ff:
|
|
fVar7 = local_24;
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("SpawnGridEntity: Grid index invalid\n"));
|
|
}
|
|
else {
|
|
fVar7 = (float)(iVar5 * gridWidth + gridX);
|
|
local_24 = fVar7;
|
|
if ((GHIDRA_INT(fVar7) < 0) || (0x1bf < GHIDRA_INT(fVar7))) goto LAB_006ff9ff;
|
|
}
|
|
if (GHIDRA_UINT(fVar7) < 0x1c0) {
|
|
uVar6 = (GHIDRA_CAST<Room *>((local_30)))->Room::GetGridCollision(GHIDRA_INT(fVar7));
|
|
if (0 < GHIDRA_INT(uVar6)) goto LAB_006ffaab;
|
|
pGVar8 = operator_new(0x158);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x28;
|
|
local_58.y = (float)pGVar8;
|
|
if (pGVar8 == GHIDRA_CAST<GridEntity *>(0x0)) {
|
|
pGVar8 = GHIDRA_CAST<GridEntity *>(0x0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<GridEntity *>((pGVar8)))->GridEntity::GridEntity();
|
|
*GHIDRA_CAST<undefined ***>(pGVar8) = IsaacRepentancePlus::GridEntity_TrapDoor::vftable;
|
|
*GHIDRA_CAST<undefined4 *>((pGVar8 + 1)) = 0;
|
|
}
|
|
local_14 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8;
|
|
if (pGVar8 == GHIDRA_CAST<GridEntity *>(0x0)) goto LAB_006ffaab;
|
|
(pGVar8->_desc)._type = 0x11;
|
|
LAB_006ffa6f:
|
|
pGVar8->_gridIndex = GHIDRA_INT(local_24);
|
|
if (local_30->_gridEntities[GHIDRA_INT(local_24)] != GHIDRA_CAST<undefined4 *>(0x0)) {
|
|
(*(code *)**GHIDRA_CAST<undefined4 **>(local_30->_gridEntities[GHIDRA_INT(local_24)]))();
|
|
}
|
|
local_30->_gridEntities[GHIDRA_INT(local_24)] = pGVar8;
|
|
(pGVar8->_desc)._variant = 0;
|
|
(pGVar8->_desc)._varData = 0;
|
|
(GHIDRA_CAST<GridEntity *>((pGVar8)))->GridEntity::Init(GHIDRA_UINT(local_34));
|
|
}
|
|
}
|
|
}
|
|
LAB_006ffaab:
|
|
pEVar4->_subtype = 1000;
|
|
}
|
|
else {
|
|
LAB_006ffac3:
|
|
local_3c = GHIDRA_CAST<int *>(damage);
|
|
fVar7 = damage;
|
|
maskedFlags = BitSet128::operator_and(&crossBombMask,&tearFlags,&g_tearFlagCrossBomb);
|
|
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)) {
|
|
bVar2 = 0;
|
|
local_38 = (Entity *)
|
|
((GHIDRA_INT((pEVar4->_damageEvents)._end) - GHIDRA_INT((pEVar4->_damageEvents)._begin)) /
|
|
0x38);
|
|
if (local_38 != GHIDRA_CAST<Entity *>(0x0)) {
|
|
piVar9 = GHIDRA_CAST<int *>((GHIDRA_INT((pEVar4->_damageEvents)._begin) + 0x34));
|
|
pEVar4 = local_38;
|
|
prevHitCount = bVar2;
|
|
do {
|
|
pEVar10 = GHIDRA_CAST<Entity *>(*piVar9);
|
|
piVar9 = piVar9 + 0xe;
|
|
bVar2 = prevHitCount + 1;
|
|
if (pEVar10 != source) {
|
|
bVar2 = prevHitCount;
|
|
}
|
|
pEVar4 = GHIDRA_CAST<Entity *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(pEVar4[-1])) + 0x40f))));
|
|
prevHitCount = bVar2;
|
|
} while (pEVar4 != GHIDRA_CAST<Entity *>(0x0));
|
|
pEVar4 = local_28;
|
|
}
|
|
iVar5 = 1 << (bVar2 & 0x1f);
|
|
local_3c = GHIDRA_CAST<int *>((fVar7 / (float)((double)iVar5 +
|
|
__uint_to_double_fixup[-(iVar5 >> 0x1f)])));
|
|
}
|
|
maskedFlags = (GHIDRA_CAST<BitSet128 *>((&g_tearFlagExplosive)))->BitSet128::__bnot(¬ExplosiveMask);
|
|
iVar5 = 0x6ffb82;
|
|
maskedFlags = BitSet128::operator_and(&nonExplosiveFlags,&tearFlags,maskedFlags);
|
|
get_tear_flags_from_player
|
|
(&damageFlags,GHIDRA_INT((auStackY_1f4 + 0x90)),*maskedFlags,iVar5,source);
|
|
takeDamageFn = *(code **)(*GHIDRA_CAST<int *>(pEVar4) + 0x20);
|
|
(GHIDRA_CAST<EntityRef *>((&sourceRef)))->EntityRef::constructor(source);
|
|
(*takeDamageFn)();
|
|
if ((((!(GHIDRA_UINT(tearFlags._l) == 0 && (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlags._l)) + 0x4))) == 0)) ||
|
|
(!(GHIDRA_UINT(tearFlags._h) == 0 && (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tearFlags._h)) + 0x4))) == 0))) && (source != GHIDRA_CAST<Entity *>(0x0))
|
|
) && ((source->_spawnerType < 10 || (999 < source->_spawnerType)))) {
|
|
bVar2 = (GHIDRA_CAST<Entity *>((pEVar4)))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
|
|
if (bVar2 != 0) {
|
|
maskedFlags = (GHIDRA_CAST<BitSet128 *>((&g_tearFlagExplosive)))->BitSet128::__bnot(¬ExplosiveMask2);
|
|
maskedFlags = BitSet128::operator_and(&nonExplosiveFlags2,&tearFlags,maskedFlags);
|
|
Entity_Tear::ApplyTearFlagEffects(pEVar4,pos,*maskedFlags,source,3.5);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
LAB_006ffd46:
|
|
local_40 = GHIDRA_CAST<GridEntity *>((GHIDRA_INT(local_40) + 1));
|
|
} while (local_40 < GHIDRA_UINT(nearby._size));
|
|
}
|
|
FUN_005cbe20();
|
|
local_14 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),0x2f);
|
|
local_28 = GHIDRA_CAST<Entity *>(((effectiveRadius * 8.0) / 40.0));
|
|
dVar15 = ceil((double)(float)local_28);
|
|
local_28 = GHIDRA_CAST<Entity *>((float)dVar15);
|
|
pGVar8 = GHIDRA_CAST<GridEntity *>(GHIDRA_INT(dVar15));
|
|
local_38 = GHIDRA_CAST<Entity *>((6.2831855 / (float)GHIDRA_INT(pGVar8)));
|
|
local_24 = 0.0;
|
|
local_40 = pGVar8;
|
|
local_28 = GHIDRA_CAST<Entity *>((GHIDRA_CAST<Room *>((g_game->_room)))->Room)::GetGridIndex(pos);
|
|
if (-1 < GHIDRA_INT(local_28)) {
|
|
std::set<int>::insert();
|
|
}
|
|
if (0 < GHIDRA_INT(pGVar8)) {
|
|
do {
|
|
local_50.x = cos(local_24);
|
|
local_50.y = sin(local_24);
|
|
pEVar4 = GHIDRA_CAST<Entity *>(0x0);
|
|
if (0.0 < effectiveRadius) {
|
|
do {
|
|
local_34 = GHIDRA_CAST<Entity *>(((float)pEVar4 + 20.0));
|
|
if (effectiveRadius <= (float)pEVar4 + 20.0) {
|
|
local_34 = GHIDRA_CAST<Entity *>(effectiveRadius);
|
|
}
|
|
local_28 = local_34;
|
|
vecResult = (GHIDRA_CAST<Vector *>((&local_50)))->Vector::__mul(GHIDRA_CAST<Vector *>(&local_78._h),GHIDRA_CAST<float *>(&local_28));
|
|
(GHIDRA_CAST<Vector *>((pos)))->Vector::__add(&local_58,vecResult);
|
|
pGVar8 = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::GetGridEntityFromPos(&local_58);
|
|
if (pGVar8 != GHIDRA_CAST<GridEntity *>(0x0)) {
|
|
local_28 = GHIDRA_CAST<Entity *>(pGVar8->_gridIndex);
|
|
std::set<int>::insert();
|
|
if ((pGVar8->_desc)._type == 3) break;
|
|
}
|
|
pEVar4 = local_34;
|
|
} while ((float)local_34 < effectiveRadius);
|
|
pGVar8 = local_40;
|
|
}
|
|
pGVar8 = GHIDRA_CAST<GridEntity *>((GHIDRA_INT(&pGVar8[-1]._sprite._bitflags) + 3));
|
|
local_24 = local_24 + (float)local_38;
|
|
local_40 = pGVar8;
|
|
} while (pGVar8 != GHIDRA_CAST<GridEntity *>(0x0));
|
|
}
|
|
local_3c = GHIDRA_CAST<int *>(*hitGridSet);
|
|
if (local_3c != hitGridSet) {
|
|
do {
|
|
piVar9 = local_3c;
|
|
(GHIDRA_CAST<Room *>((g_game->_room)))->Room::GetGridPosition(&local_58,local_3c[4]);
|
|
bVar2 = (GHIDRA_CAST<Room *>((savedGame->_room)))->Room::CheckLine(pos,&local_58,2,0,0,0,GHIDRA_CAST<Vector *>(0x0));
|
|
if (bVar2 != 0) {
|
|
uVar6 = piVar9[4];
|
|
local_28 = GHIDRA_CAST<Entity *>((GHIDRA_CAST<Room *>((savedGame->_room)))->Room)::GetGridCollision(uVar6);
|
|
if (uVar6 < 0x1c0) {
|
|
pGVar8 = *GHIDRA_CAST<GridEntity **>((GHIDRA_CAST<char *>(savedGame->_room) + uVar6 * 4 + 0x24));
|
|
local_40 = pGVar8;
|
|
if ((pGVar8 == GHIDRA_CAST<GridEntity *>(0x0)) || ((pGVar8->_desc)._type != 0xb)) goto LAB_006fff72;
|
|
cVar3 = FUN_00711fd0();
|
|
if (cVar3 == '\0') goto LAB_006fff72;
|
|
}
|
|
else {
|
|
local_40 = GHIDRA_CAST<GridEntity *>(0x0);
|
|
LAB_006fff72:
|
|
pRVar12 = savedGame->_room;
|
|
(GHIDRA_CAST<EntityRef *>((&sourceRef)))->EntityRef::constructor(source);
|
|
cVar3 = Room::DestroyGridWithSource(pRVar12);
|
|
if (cVar3 == '\0') goto LAB_0070001a;
|
|
pGVar8 = local_40;
|
|
}
|
|
if (local_28 == GHIDRA_CAST<Entity *>(0x3)) {
|
|
vecResult = (GHIDRA_CAST<Vector *>((&local_58)))->Vector::__sub(GHIDRA_CAST<Vector *>(&local_78._h),pos);
|
|
Vector::ToCardinal(&local_50,vecResult);
|
|
local_28 = GHIDRA_CAST<Entity *>(0x42200000);
|
|
vecResult = (GHIDRA_CAST<Vector *>((player)))->Vector::__mul(&local_68,GHIDRA_CAST<float *>(&local_28));
|
|
vecResult = (GHIDRA_CAST<Vector *>((&local_58)))->Vector::__add(&local_90,vecResult);
|
|
iVar5 = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::GetGridIndex(vecResult);
|
|
if (-1 < iVar5) {
|
|
if (iVar5 < 0x1c0) {
|
|
pit = savedGame->_room->_gridEntities[iVar5];
|
|
}
|
|
else {
|
|
pit = GHIDRA_CAST<GridEntity *>(0x0);
|
|
}
|
|
(GHIDRA_CAST<Room *>((savedGame->_room)))->Room::TryMakeBridge(pit,pGVar8);
|
|
}
|
|
}
|
|
}
|
|
LAB_0070001a:
|
|
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>
|
|
*)&local_3c);
|
|
} while (local_3c != hitGridSet);
|
|
}
|
|
FUN_00424420();
|
|
(GHIDRA_CAST<EntityList_Query *>((&nearby)))->EntityList_Query::~EntityList_Query();
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 00703190
|
|
Entity * Game::spawn_bomb_crater(Vector *position, Entity *spawner, float scale)
|
|
{
|
|
int iVar1;
|
|
void *pvVar2;
|
|
uint uVar3;
|
|
uint seed;
|
|
Entity *crater;
|
|
int saveStateBytes;
|
|
float scaleY;
|
|
EntitySaveState saveState;
|
|
undefined4 saveStateVariant;
|
|
float saveStateScale;
|
|
float saveStatePosX;
|
|
float saveStatePosY;
|
|
int saveStateInitSeed;
|
|
float savedScale;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
EntitySaveState *saveStateEnd;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00afc320;
|
|
local_10 = ExceptionList;
|
|
uVar3 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
ExceptionList = &local_10;
|
|
savedScale = scale;
|
|
seed = Random();
|
|
crater = Spawn(g_game,1000,0x12,position,&g_vectorZero,spawner,0,seed);
|
|
scaleY = savedScale * g_vectorOne.y;
|
|
iVar1 = *GHIDRA_CAST<int *>(crater);
|
|
(crater->_sprite)._scale.x = savedScale * g_vectorOne.x;
|
|
(crater->_sprite)._scale.y = scaleY;
|
|
(**(code **)(iVar1 + 0xc))(uVar3);
|
|
(GHIDRA_CAST<EntitySaveState *>((&saveState)))->EntitySaveState::constructor();
|
|
local_8 = 0;
|
|
saveStatePosX = position->x;
|
|
pvVar2 = this->_room;
|
|
saveStatePosY = position->y;
|
|
saveState = (EntitySaveState)0x3e8;
|
|
saveStateVariant = 0x12;
|
|
saveStateInitSeed = crater->_initSeed;
|
|
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar2) + 4));
|
|
saveStateBytes = *GHIDRA_CAST<int *>((iVar1 + 0x8c)) - *GHIDRA_CAST<int *>((iVar1 + 0x88));
|
|
saveStateScale = savedScale;
|
|
while (0x80 < saveStateBytes / 0x78 + 1U) {
|
|
std::vector<EntitySaveState>::erase(&spawner,*GHIDRA_CAST<undefined4 *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar2) + 4)) + 0x88)));
|
|
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar2) + 4));
|
|
saveStateBytes = *GHIDRA_CAST<int *>((iVar1 + 0x8c)) - *GHIDRA_CAST<int *>((iVar1 + 0x88));
|
|
}
|
|
saveStateEnd = *GHIDRA_CAST<EntitySaveState **>((iVar1 + 0x8c));
|
|
if (saveStateEnd == *GHIDRA_CAST<EntitySaveState **>((iVar1 + 0x90))) {
|
|
std::vector<EntitySaveState>::_Emplace_reallocate(saveStateEnd,&saveState);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<EntitySaveState *>((saveStateEnd)))->EntitySaveState::copy(&saveState);
|
|
*GHIDRA_CAST<int *>((iVar1 + 0x8c)) = *GHIDRA_CAST<int *>((iVar1 + 0x8c)) + 0x78;
|
|
}
|
|
invoke_pending_callbacks(&saveState);
|
|
ExceptionList = local_10;
|
|
return crater;
|
|
}
|
|
|
|
// 00703460
|
|
Font * Game::GetFont()
|
|
{
|
|
return &g_manager->_font2_TeamMeatEx12;
|
|
}
|
|
|
|
// 00703470
|
|
void Game::AddEncounteredBoss(int type, int variant)
|
|
{
|
|
uint i;
|
|
uint bossCount;
|
|
int bossType;
|
|
int bossVariant;
|
|
Game *local_8;
|
|
int bossesBegin;
|
|
int *bossesEnd;
|
|
|
|
bossesBegin = *GHIDRA_CAST<int *>(this->_encounteredBosses);
|
|
i = 0;
|
|
bossCount = *GHIDRA_CAST<int *>((this->_encounteredBosses + 4)) - bossesBegin >> 3;
|
|
if (bossCount != 0) {
|
|
do {
|
|
if ((*GHIDRA_CAST<int *>((bossesBegin + i * 8)) == type) && (*GHIDRA_CAST<int *>((bossesBegin + 4 + i * 8)) == variant))
|
|
{
|
|
return;
|
|
}
|
|
i = i + 1;
|
|
} while (i < bossCount);
|
|
}
|
|
if ((((type < 0x2e) || (0x34 < type)) && (type != 0x26)) && ((type != 0x104 || (variant != 10))))
|
|
{
|
|
bossType = type;
|
|
bossVariant = variant;
|
|
bossesEnd = *GHIDRA_CAST<int **>((this->_encounteredBosses + 4));
|
|
if (bossesEnd != *GHIDRA_CAST<int **>((this->_encounteredBosses + 8))) {
|
|
*bossesEnd = type;
|
|
bossesEnd[1] = variant;
|
|
*GHIDRA_CAST<int *>((this->_encounteredBosses + 4)) = *GHIDRA_CAST<int *>((this->_encounteredBosses + 4)) + 8;
|
|
return;
|
|
}
|
|
local_8 = this;
|
|
std::vector<8byte>::_Emplace_reallocate(bossesEnd,&bossType);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00703510
|
|
byte Game::HasEncounteredBoss(int type, int variant)
|
|
{
|
|
uint bossIndex;
|
|
uint bossCount;
|
|
int bosses;
|
|
|
|
bosses = *GHIDRA_CAST<int *>(this->_encounteredBosses);
|
|
bossIndex = 0;
|
|
bossCount = *GHIDRA_CAST<int *>((this->_encounteredBosses + 4)) - bosses >> 3;
|
|
if (bossCount != 0) {
|
|
do {
|
|
if ((*GHIDRA_CAST<int *>((bosses + bossIndex * 8)) == type) &&
|
|
(*GHIDRA_CAST<int *>((bosses + 4 + bossIndex * 8)) == variant)) {
|
|
return 1;
|
|
}
|
|
bossIndex = bossIndex + 1;
|
|
} while (bossIndex < bossCount);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 00703560
|
|
char Game::GetGreedWavesNum()
|
|
{
|
|
return (this->_difficulty == 3) + '\v';
|
|
}
|
|
|
|
// 00703570
|
|
char Game::GetGreedBossWaveNum()
|
|
{
|
|
return (this->_difficulty == 3) + '\t';
|
|
}
|
|
|
|
// 00703670
|
|
void Game::ShakeScreen(int timeout)
|
|
{
|
|
void *playerListEnd;
|
|
int *piVar1;
|
|
uint playerIdx;
|
|
float rumbleParams [2];
|
|
Manager *manager;
|
|
|
|
manager = g_manager;
|
|
this->_screenShakeTimer = timeout;
|
|
if ((manager->_optionsConfig)._enableRumble != 0) {
|
|
playerListEnd = (this->_playerManager)._playerList._end;
|
|
playerIdx = 0;
|
|
piVar1 = (this->_playerManager)._playerList._begin;
|
|
if (GHIDRA_INT(playerListEnd) - GHIDRA_INT(piVar1) >> 2 != 0) {
|
|
do {
|
|
if (GHIDRA_INT(playerListEnd) - GHIDRA_INT(piVar1) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
playerListEnd = (this->_playerManager)._playerList._end;
|
|
piVar1 = (this->_playerManager)._playerList._begin;
|
|
}
|
|
if (playerIdx < GHIDRA_UINT((GHIDRA_INT(playerListEnd) - GHIDRA_INT(piVar1) >> 2))) {
|
|
piVar1 = piVar1 + playerIdx;
|
|
}
|
|
rumbleParams[1] = 0.5;
|
|
rumbleParams[0] = (float)timeout / 60.0;
|
|
(**(code **)(PTR_vftable_00c57b18 + 0x74))
|
|
(*GHIDRA_CAST<undefined4 *>((*piVar1 + 0x1618)),FUN_00a20b70,rumbleParams,rumbleParams + 1,0);
|
|
playerListEnd = (this->_playerManager)._playerList._end;
|
|
playerIdx = playerIdx + 1;
|
|
piVar1 = (this->_playerManager)._playerList._begin;
|
|
} while (playerIdx < GHIDRA_UINT((GHIDRA_INT(playerListEnd) - GHIDRA_INT(piVar1) >> 2)));
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00703770
|
|
void Game::MakeShockwave(Vector *pos, float amplitude, float speed, int duration)
|
|
{
|
|
int *piVar1;
|
|
uint shockwaveId;
|
|
void *gameRoom;
|
|
float posX;
|
|
float posY;
|
|
void *room;
|
|
int shockwaveSlot;
|
|
|
|
room = this->_room;
|
|
posX = pos->x;
|
|
posY = pos->y;
|
|
gameRoom = g_game->_room;
|
|
piVar1 = GHIDRA_CAST<int *>((GHIDRA_INT(gameRoom) + 0x70fc));
|
|
*piVar1 = *piVar1 + 1;
|
|
shockwaveId = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(gameRoom) + 0x70fc)) & 0x80000001;
|
|
if (GHIDRA_INT(shockwaveId) < 0) {
|
|
shockwaveId = (shockwaveId - 1 | 0xfffffffe) + 1;
|
|
}
|
|
if (1 < shockwaveId) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Shockwave id is too large!"));
|
|
}
|
|
shockwaveSlot = shockwaveId + 0x407;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(room) + shockwaveSlot * 0x1c)) = posX;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(room) + shockwaveSlot * 0x1c + 4)) = posY;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(room) + shockwaveSlot * 0x1c + 0xc)) = amplitude;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(room) + shockwaveSlot * 0x1c + 8)) = 0;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(room) + shockwaveSlot * 0x1c + 0x10)) = speed;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(room) + shockwaveSlot * 0x1c + 0x14)) = 0;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + shockwaveSlot * 0x1c + 0x18)) = duration;
|
|
return;
|
|
}
|
|
|
|
// 00703830
|
|
void Game::SetBloom(int Time, float Strength)
|
|
{
|
|
this->_bloomDuration = Time;
|
|
this->_bloomTimer = Time;
|
|
this->_bloomStrength = Strength;
|
|
return;
|
|
}
|
|
|
|
// 00703850
|
|
Entity_Player * Game::GetRandomPlayer(Vector *position, float radius)
|
|
{
|
|
uint swapTmp;
|
|
uint swapIdx;
|
|
int shuffleIdx;
|
|
Entity_Player *player;
|
|
float dy;
|
|
float dx;
|
|
int playersBegin;
|
|
int playersEnd;
|
|
uint playerCount;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
undefined4 swapTmp;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00afc34d;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
std::vector<int>::copy_constructor(&this->_playerManager);
|
|
local_8 = 0;
|
|
swapTmp = playersEnd - playersBegin >> 2;
|
|
shuffleIdx = swapTmp - 1;
|
|
playerCount = swapTmp;
|
|
if (0 < shuffleIdx) {
|
|
do {
|
|
if (swapTmp == 0) {
|
|
swapIdx = 0;
|
|
}
|
|
else {
|
|
swapIdx = Random();
|
|
swapIdx = swapIdx % swapTmp;
|
|
}
|
|
swapTmp = *GHIDRA_CAST<undefined4 *>((playersBegin + shuffleIdx * 4));
|
|
swapTmp = swapTmp - 1;
|
|
*GHIDRA_CAST<undefined4 *>((playersBegin + shuffleIdx * 4)) = *GHIDRA_CAST<undefined4 *>((playersBegin + swapIdx * 4));
|
|
shuffleIdx = shuffleIdx + -1;
|
|
*GHIDRA_CAST<undefined4 *>((playersBegin + swapIdx * 4)) = swapTmp;
|
|
} while (0 < shuffleIdx);
|
|
}
|
|
swapTmp = 0;
|
|
if (playerCount != 0) {
|
|
do {
|
|
player = *GHIDRA_CAST<Entity_Player **>((playersBegin + swapTmp * 4));
|
|
dy = position->y - (player->_pos).y;
|
|
dx = position->x - (player->_pos).x;
|
|
if (dy * dy + dx * dx < radius * radius) goto LAB_00703922;
|
|
swapTmp = swapTmp + 1;
|
|
} while (swapTmp < playerCount);
|
|
}
|
|
player = *GHIDRA_CAST<Entity_Player **>((playersEnd + -4));
|
|
LAB_00703922:
|
|
FID_conflict__Tidy(&playersBegin);
|
|
ExceptionList = local_10;
|
|
return player;
|
|
}
|
|
|
|
// 00703950
|
|
Entity_Player * Game::GetNearestPlayer(Vector *pos)
|
|
{
|
|
int *playerSlot;
|
|
Entity_Player *player;
|
|
int *playersBegin;
|
|
uint playerIdx;
|
|
void *playersEnd;
|
|
float fVar1;
|
|
float distSq;
|
|
float deltaY;
|
|
float fVar2;
|
|
Entity_Player *nearestPlayer;
|
|
float nearestDistSq;
|
|
|
|
playersEnd = (this->_playerManager)._playerList._end;
|
|
playersBegin = (this->_playerManager)._playerList._begin;
|
|
if (GHIDRA_INT(playersEnd) - GHIDRA_INT(playersBegin) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
playersEnd = (this->_playerManager)._playerList._end;
|
|
playersBegin = (this->_playerManager)._playerList._begin;
|
|
}
|
|
playerIdx = 1;
|
|
nearestPlayer = GHIDRA_CAST<Entity_Player *>(*playersBegin);
|
|
fVar1 = pos->x - (nearestPlayer->_pos).x;
|
|
fVar2 = pos->y - (nearestPlayer->_pos).y;
|
|
nearestDistSq = fVar2 * fVar2 + fVar1 * fVar1;
|
|
fVar1 = nearestDistSq;
|
|
if (1 < GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2))) {
|
|
do {
|
|
fVar2 = fVar1;
|
|
if (GHIDRA_INT(playersEnd) - GHIDRA_INT(playersBegin) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
playersEnd = (this->_playerManager)._playerList._end;
|
|
fVar2 = nearestDistSq;
|
|
}
|
|
playersBegin = (this->_playerManager)._playerList._begin;
|
|
playerSlot = playersBegin + playerIdx;
|
|
if (GHIDRA_UINT((GHIDRA_INT(playersEnd) - GHIDRA_INT(playersBegin) >> 2)) <= playerIdx) {
|
|
playerSlot = playersBegin;
|
|
}
|
|
player = GHIDRA_CAST<Entity_Player *>(*playerSlot);
|
|
deltaY = pos->y - (player->_pos).y;
|
|
distSq = pos->x - (player->_pos).x;
|
|
distSq = deltaY * deltaY + distSq * distSq;
|
|
if (distSq < fVar2) {
|
|
fVar2 = distSq;
|
|
nearestDistSq = distSq;
|
|
}
|
|
if (fVar1 <= distSq) {
|
|
player = nearestPlayer;
|
|
}
|
|
playerIdx = playerIdx + 1;
|
|
fVar1 = fVar2;
|
|
nearestPlayer = player;
|
|
} while (playerIdx <
|
|
GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2)));
|
|
}
|
|
return nearestPlayer;
|
|
}
|
|
|
|
// 00703be0
|
|
void Game::Fart(Vector *pos, float radius, Entity *source, float scale, int subType, ColorMod *color)
|
|
{
|
|
qword qVar1;
|
|
byte bVar2;
|
|
Entity_Player *sourcePlayer;
|
|
uint uVar3;
|
|
Entity *pEVar4;
|
|
Vector *extraout_ECX;
|
|
Vector *extraout_ECX_00;
|
|
Vector *direction;
|
|
qword *heapUsage;
|
|
float fVar5;
|
|
float pushDirY;
|
|
float pushDirX;
|
|
EntityRef sourceRef;
|
|
EntityList_EL entities;
|
|
Vector knockback;
|
|
float fartScale;
|
|
int trinketMultiplier;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
Entity *fartSource;
|
|
int multiplier;
|
|
code *takeDamage;
|
|
|
|
fartSource = source;
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00afc37d;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
trinketMultiplier = 0;
|
|
if (((source == GHIDRA_CAST<Entity *>(0x0)) ||
|
|
(sourcePlayer = GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity *>((source)))->Entity)::GetPlayerAncestor(),
|
|
sourcePlayer == GHIDRA_CAST<Entity_Player *>(0x0))) ||
|
|
(bVar2 = (GHIDRA_CAST<Entity_Player *>((sourcePlayer)))->Entity_Player::HasTrinket(0x86,0), bVar2 == 0)) {
|
|
fartScale = scale;
|
|
}
|
|
else {
|
|
radius = radius + radius;
|
|
fartScale = scale + scale;
|
|
trinketMultiplier = (GHIDRA_CAST<Entity_Player *>((sourcePlayer)))->Entity_Player::GetTrinketMultiplier(0x86);
|
|
}
|
|
EntityList::QueryRadius(GHIDRA_CAST<EntityList *>((GHIDRA_INT(this->_room) + 0x1218)),&entities,pos,radius,0xffffffff)
|
|
;
|
|
local_8 = 0;
|
|
source = GHIDRA_CAST<Entity *>(0x0);
|
|
if (GHIDRA_CAST<undefined1 *>(entities._size) != GHIDRA_CAST<undefined1 *>(0x0)) {
|
|
do {
|
|
pEVar4 = *GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(entities._data) + GHIDRA_INT(source) * 4));
|
|
if ((((pEVar4 != fartSource) && (pEVar4->_entityGridCollisionClass != 4)) &&
|
|
((pEVar4->_mass != 0.0 &&
|
|
(bVar2 = (GHIDRA_CAST<Entity *>((pEVar4)))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0)), bVar2 != 0)))) &&
|
|
(((pEVar4->_type != 1 || (fartSource == GHIDRA_CAST<Entity *>(0x0))) ||
|
|
(bVar2 = (GHIDRA_CAST<Entity *>((fartSource)))->Entity::IsDescendantOf(pEVar4), bVar2 == 0)))) {
|
|
(GHIDRA_CAST<EntityRef *>((&sourceRef)))->EntityRef::constructor(fartSource);
|
|
(GHIDRA_CAST<Entity *>((pEVar4)))->Entity::AddPoison(&sourceRef,200,0.0,0);
|
|
takeDamage = *(code **)(*GHIDRA_CAST<int *>(pEVar4) + 0x20);
|
|
(GHIDRA_CAST<EntityRef *>((&sourceRef)))->EntityRef::constructor(fartSource);
|
|
(*takeDamage)(0x40a00000,0,0,&sourceRef,0x1e);
|
|
multiplier = trinketMultiplier;
|
|
if (1 < trinketMultiplier) {
|
|
pushDirY = (pEVar4->_pos).y - pos->y;
|
|
pushDirX = (pEVar4->_pos).x - pos->x;
|
|
fVar5 = sqrtf(pushDirY * pushDirY + pushDirX * pushDirX);
|
|
if (0.0 < fVar5) {
|
|
pushDirX = pushDirX * (1.0 / fVar5);
|
|
pushDirY = pushDirY * (1.0 / fVar5);
|
|
}
|
|
knockback.x = pushDirX * 8.0;
|
|
knockback.y = pushDirY * 8.0;
|
|
(GHIDRA_CAST<EntityRef *>((&sourceRef)))->EntityRef::constructor(fartSource);
|
|
Entity::AddKnockback(pEVar4,&sourceRef,&knockback,0x12,0);
|
|
}
|
|
if (2 < multiplier) {
|
|
(GHIDRA_CAST<EntityRef *>((&sourceRef)))->EntityRef::constructor(fartSource);
|
|
(GHIDRA_CAST<Entity *>((pEVar4)))->Entity::AddConfusion(&sourceRef,0x5a,0);
|
|
}
|
|
}
|
|
source = GHIDRA_CAST<Entity *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((source)) + 0x1))));
|
|
} while (source < GHIDRA_UINT(entities._size));
|
|
}
|
|
uVar3 = Random();
|
|
pEVar4 = Spawn(g_game,1000,0x22,pos,&g_vectorZero,fartSource,subType,uVar3);
|
|
pEVar4->SetColor(color,0xffffffff,0xff,0,1);
|
|
fVar5 = fartScale * g_vectorOne.y;
|
|
(pEVar4->_sprite)._scale.x = fartScale * g_vectorOne.x;
|
|
(pEVar4->_sprite)._scale.y = fVar5;
|
|
direction = extraout_ECX;
|
|
if (1.8 < fartScale) {
|
|
(GHIDRA_CAST<SFXManager *>((&g_manager->_sfxManager)))->SFXManager::Stop(0x25);
|
|
(GHIDRA_CAST<SoundEffects *>((&g_manager->_sfxManager)))->SoundEffects::Play(0x25,1.0,0,0,1.0,0.0);
|
|
(GHIDRA_CAST<SoundEffects *>((&g_manager->_sfxManager)))->SoundEffects::Play(0x25,1.2,0x14,0,0.5,0.0);
|
|
ShakeScreen(g_game,3);
|
|
direction = extraout_ECX_00;
|
|
}
|
|
if ((fartSource != GHIDRA_CAST<Entity *>(0x0)) && (fartSource->_type == 1)) {
|
|
(GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(fartSource))))->Entity_Player::ShootCandle(direction);
|
|
}
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(entities)) + 0x0))) == '\0') {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
heapUsage = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
heapUsage = GHIDRA_CAST<qword *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
if (entities._data != (void *)0x0) {
|
|
uVar3 = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(entities._data) + -4));
|
|
qVar1 = *heapUsage;
|
|
*GHIDRA_CAST<uint *>(heapUsage) = GHIDRA_UINT(*heapUsage) - uVar3;
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(heapUsage) + 4)) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(heapUsage) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar1) < uVar3));
|
|
free((void *)(GHIDRA_INT(entities._data) + -4));
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00703f90
|
|
void Game::CharmFart(Vector *position, float radius, Entity *source)
|
|
{
|
|
qword qVar1;
|
|
byte bVar2;
|
|
Entity_Player *this;
|
|
Entity *fartEffect;
|
|
Vector *extraout_ECX;
|
|
Vector *extraout_ECX_00;
|
|
Vector *direction;
|
|
qword *heapUsage;
|
|
uint uVar3;
|
|
float fVar4;
|
|
EntityRef sourceRef;
|
|
EntityList_EL entities;
|
|
Vector knockback;
|
|
float fartScale;
|
|
Vector *positionLocal;
|
|
float pushDirX;
|
|
int trinketMultiplier;
|
|
float local_48;
|
|
ColorMod charmColor;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00afc3ad;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
positionLocal = position;
|
|
fartScale = 1.0;
|
|
trinketMultiplier = 0;
|
|
if (((source == GHIDRA_CAST<Entity *>(0x0)) ||
|
|
(this = GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity *>((source)))->Entity)::GetPlayerAncestor(), this == GHIDRA_CAST<Entity_Player *>(0x0))) ||
|
|
(bVar2 = this->Entity_Player::HasTrinket(0x86,0), bVar2 == 0)) {
|
|
}
|
|
else {
|
|
local_48 = radius + radius;
|
|
fartScale = 2.0;
|
|
trinketMultiplier = this->Entity_Player::GetTrinketMultiplier(0x86);
|
|
radius = local_48;
|
|
}
|
|
EntityList::QueryRadius
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),&entities,position,radius,0xffffffff);
|
|
uVar3 = 0;
|
|
local_8 = 0;
|
|
if (entities._size != 0) {
|
|
do {
|
|
fartEffect = *GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(entities._data) + uVar3 * 4));
|
|
if ((((fartEffect != source) && (fartEffect->_entityGridCollisionClass != 4)) &&
|
|
((fartEffect->_mass != 0.0 &&
|
|
(bVar2 = (GHIDRA_CAST<Entity *>((fartEffect)))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0)), bVar2 != 0)))) &&
|
|
(((fartEffect->_type != 1 || (source == GHIDRA_CAST<Entity *>(0x0))) ||
|
|
(bVar2 = (GHIDRA_CAST<Entity *>((source)))->Entity::IsDescendantOf(fartEffect), bVar2 == 0)))) {
|
|
(GHIDRA_CAST<EntityRef *>((&sourceRef)))->EntityRef::constructor(source);
|
|
(GHIDRA_CAST<Entity *>((fartEffect)))->Entity::AddCharmed(&sourceRef,0x96,0,0);
|
|
if (1 < trinketMultiplier) {
|
|
local_48 = (fartEffect->_pos).y - positionLocal->y;
|
|
pushDirX = (fartEffect->_pos).x - positionLocal->x;
|
|
fVar4 = sqrtf(local_48 * local_48 + pushDirX * pushDirX);
|
|
if (fVar4 <= 0.0) {
|
|
knockback.y = local_48;
|
|
knockback.x = pushDirX;
|
|
}
|
|
else {
|
|
knockback.y = local_48 * (1.0 / fVar4);
|
|
knockback.x = pushDirX * (1.0 / fVar4);
|
|
}
|
|
knockback.x = knockback.x * 8.0;
|
|
knockback.y = knockback.y * 8.0;
|
|
(GHIDRA_CAST<EntityRef *>((&sourceRef)))->EntityRef::constructor(source);
|
|
Entity::AddKnockback(fartEffect,&sourceRef,&knockback,0x12,0);
|
|
}
|
|
if (2 < trinketMultiplier) {
|
|
(GHIDRA_CAST<EntityRef *>((&sourceRef)))->EntityRef::constructor(source);
|
|
(GHIDRA_CAST<Entity *>((fartEffect)))->Entity::AddConfusion(&sourceRef,0x5a,0);
|
|
}
|
|
}
|
|
uVar3 = uVar3 + 1;
|
|
} while (uVar3 < GHIDRA_UINT(entities._size));
|
|
}
|
|
uVar3 = Random();
|
|
fartEffect = Spawn(g_game,1000,0x22,positionLocal,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar3);
|
|
charmColor._offset[0] = 0.0;
|
|
charmColor._tint[0] = 1.0;
|
|
charmColor._tint[1] = 1.0;
|
|
charmColor._tint[2] = 1.0;
|
|
charmColor._tint[3] = 1.0;
|
|
charmColor._offset[1] = 0.0;
|
|
charmColor._offset[2] = 0.0;
|
|
charmColor._colorize[0] = 1.0;
|
|
charmColor._colorize[1] = 0.0;
|
|
charmColor._colorize[2] = 1.0;
|
|
charmColor._colorize[3] = 1.0;
|
|
fartEffect->SetColor(&charmColor,0xffffffff,0xff,0,1);
|
|
fVar4 = fartScale * g_vectorOne.y;
|
|
(fartEffect->_sprite)._scale.x = fartScale * g_vectorOne.x;
|
|
(fartEffect->_sprite)._scale.y = fVar4;
|
|
direction = extraout_ECX;
|
|
if (1.8 < fartScale) {
|
|
(GHIDRA_CAST<SFXManager *>((&g_manager->_sfxManager)))->SFXManager::Stop(0x25);
|
|
(GHIDRA_CAST<SoundEffects *>((&g_manager->_sfxManager)))->SoundEffects::Play(0x25,1.0,0,0,1.0,0.0);
|
|
(GHIDRA_CAST<SoundEffects *>((&g_manager->_sfxManager)))->SoundEffects::Play(0x25,1.2,0x14,0,0.5,0.0);
|
|
ShakeScreen(g_game,3);
|
|
direction = extraout_ECX_00;
|
|
}
|
|
if ((source != GHIDRA_CAST<Entity *>(0x0)) && (source->_type == 1)) {
|
|
(GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(source))))->Entity_Player::ShootCandle(direction);
|
|
}
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(entities)) + 0x0))) == '\0') {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
heapUsage = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
heapUsage = GHIDRA_CAST<qword *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
if (entities._data != (void *)0x0) {
|
|
uVar3 = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(entities._data) + -4));
|
|
qVar1 = *heapUsage;
|
|
*GHIDRA_CAST<uint *>(heapUsage) = GHIDRA_UINT(*heapUsage) - uVar3;
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(heapUsage) + 4)) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(heapUsage) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar1) < uVar3));
|
|
free((void *)(GHIDRA_INT(entities._data) + -4));
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00704b10
|
|
void Game::AddDevilRoomDeal()
|
|
{
|
|
this->_devilRoomDeals = this->_devilRoomDeals + 1;
|
|
if (2 < this->_devilRoomDeals) {
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(0x4f);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00704b30
|
|
void Game::DonateGreed(int param_2)
|
|
{
|
|
this->_donationModGreed = this->_donationModGreed + param_2;
|
|
return;
|
|
}
|
|
|
|
// 00704b40
|
|
void Game::DonateAngel(int param_2)
|
|
{
|
|
this->_donationModAngel = this->_donationModAngel + param_2;
|
|
return;
|
|
}
|
|
|
|
// 00704b70
|
|
void Game::RerollLevelCollectibles()
|
|
{
|
|
int iVar1;
|
|
byte isRerollable;
|
|
int savedEntitiesBytes;
|
|
std_vector *savedEntities;
|
|
void *entityStates;
|
|
int roomIndex;
|
|
uint entityIndex;
|
|
int entityOffset;
|
|
|
|
roomIndex = 0;
|
|
if (0 < this->_nbRooms) {
|
|
savedEntities = &this->_roomList[0].SavedEntities;
|
|
do {
|
|
entityStates = savedEntities->_begin;
|
|
entityIndex = 0;
|
|
savedEntitiesBytes = GHIDRA_INT(savedEntities->_end) - GHIDRA_INT(entityStates);
|
|
iVar1 = savedEntitiesBytes >> 0x1f;
|
|
if (savedEntitiesBytes / 0x78 + iVar1 != iVar1) {
|
|
entityOffset = 0;
|
|
do {
|
|
if ((((*GHIDRA_CAST<int *>((entityOffset + GHIDRA_INT(entityStates))) == 5) &&
|
|
(*GHIDRA_CAST<int *>((entityOffset + 4 + GHIDRA_INT(entityStates))) == 100)) &&
|
|
(iVar1 = *GHIDRA_CAST<int *>((entityOffset + 8 + GHIDRA_INT(entityStates))), iVar1 != 0)) &&
|
|
(isRerollable = Entity_Pickup::CanRerollVariant(100,iVar1), isRerollable != 0)) {
|
|
*GHIDRA_CAST<undefined4 *>((entityOffset + 8 + GHIDRA_INT(entityStates))) = 0;
|
|
*GHIDRA_CAST<undefined1 *>((entityOffset + 0x22 + GHIDRA_INT(savedEntities->_begin))) = 0;
|
|
entityStates = savedEntities->_begin;
|
|
}
|
|
entityIndex = entityIndex + 1;
|
|
entityOffset = entityOffset + 0x78;
|
|
} while (entityIndex < GHIDRA_UINT(((GHIDRA_INT(savedEntities->_end) - GHIDRA_INT(entityStates)) / 0x78)));
|
|
}
|
|
roomIndex = roomIndex + 1;
|
|
savedEntities = GHIDRA_CAST<std_vector *>((GHIDRA_INT((savedEntities + 0xf)) + 4));
|
|
} while (roomIndex < this->_nbRooms);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00704c50
|
|
void Game::RerollLevelPickups(uint seed)
|
|
{
|
|
code *pcVar1;
|
|
bool bVar2;
|
|
byte bVar3;
|
|
uint rngResult;
|
|
int iVar4;
|
|
int pickupVariant;
|
|
void *pvVar5;
|
|
undefined4 *playerSlot;
|
|
Entity_Player *player;
|
|
std_vector *savedEntities;
|
|
int roomIdx;
|
|
uint rerollSeed;
|
|
uint entityIndex;
|
|
int entityOffset;
|
|
Game *game;
|
|
|
|
roomIdx = 0;
|
|
if (0 < this->_nbRooms) {
|
|
savedEntities = &this->_roomList[0].SavedEntities;
|
|
do {
|
|
pvVar5 = savedEntities->_begin;
|
|
entityIndex = 0;
|
|
iVar4 = GHIDRA_INT(savedEntities->_end) - GHIDRA_INT(pvVar5);
|
|
pickupVariant = iVar4 >> 0x1f;
|
|
if (iVar4 / 0x78 + pickupVariant != pickupVariant) {
|
|
entityOffset = 0;
|
|
LAB_00704ca2:
|
|
if (((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar5) + entityOffset)) == 5) &&
|
|
(pickupVariant = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar5) + entityOffset + 4)), pickupVariant != 100)) &&
|
|
(bVar3 = Entity_Pickup::CanRerollVariant
|
|
(pickupVariant,*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar5) + entityOffset + 8))), bVar3 != 0))
|
|
{
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar5) + entityOffset + 0x14)) == 0) {
|
|
rerollSeed = seed;
|
|
LAB_00704d00:
|
|
rngResult = Random();
|
|
pickupVariant = (rngResult % 6 + 1) * 10;
|
|
if (pickupVariant == 0x3c) {
|
|
rngResult = Random();
|
|
if ((rngResult & 1) == 0) {
|
|
pickupVariant = 10;
|
|
}
|
|
}
|
|
else if ((pickupVariant == 0x32) && (rngResult = Random(), rngResult % 3 == 0)) {
|
|
pickupVariant = 0x14;
|
|
}
|
|
rngResult = Random();
|
|
if (rngResult % 10 == 0) {
|
|
rngResult = Random();
|
|
pickupVariant = ((rngResult & 1) + 3) * 10;
|
|
}
|
|
rngResult = Random();
|
|
if (rngResult % 0xf == 0) {
|
|
pickupVariant = 300;
|
|
}
|
|
rngResult = Random();
|
|
if (rngResult % 0xf == 0) {
|
|
pickupVariant = 0x46;
|
|
}
|
|
rngResult = Random();
|
|
game = g_game;
|
|
if (rngResult % 0x14 == 0) {
|
|
pickupVariant = 0x15e;
|
|
}
|
|
else if (pickupVariant == 10) {
|
|
pvVar5 = (g_manager->_itemConfig)._trinkets._begin;
|
|
if (((GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._trinkets._end) - GHIDRA_INT(pvVar5) & 0xfffffffcU))
|
|
< 0x59) || (iVar4 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar5) + 0x58)), iVar4 == 0)) ||
|
|
(bVar2 = true, (*GHIDRA_CAST<uint *>((iVar4 + 0xb8)) & 0x80000000) == 0)) {
|
|
bVar2 = false;
|
|
}
|
|
playerSlot = (g_game->_playerManager)._playerList._begin;
|
|
if (playerSlot != (g_game->_playerManager)._playerList._end) {
|
|
do {
|
|
player = GHIDRA_CAST<Entity_Player *>(*playerSlot);
|
|
if (player->_variant == 0) {
|
|
bVar3 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasTrinket(0x16,0);
|
|
if (bVar3 != 0) goto LAB_00704e59;
|
|
if (((bVar2) && (player->_backupPlayer != GHIDRA_CAST<Entity_Player *>(0x0))) &&
|
|
(bVar3 = (GHIDRA_CAST<Entity_Player *>((player->_backupPlayer)))->Entity_Player::HasTrinket(0x16,0), bVar3 != 0)
|
|
) goto LAB_00704e53;
|
|
}
|
|
playerSlot = playerSlot + 1;
|
|
if (playerSlot == (game->_playerManager)._playerList._end) break;
|
|
} while( true );
|
|
}
|
|
}
|
|
goto LAB_00704eb0;
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar5) + entityOffset + 4)) = 0x96;
|
|
goto LAB_00704ebe;
|
|
}
|
|
goto LAB_00704ec8;
|
|
}
|
|
LAB_00704ef7:
|
|
roomIdx = roomIdx + 1;
|
|
savedEntities = GHIDRA_CAST<std_vector *>((GHIDRA_INT((savedEntities + 0xf)) + 4));
|
|
} while (roomIdx < this->_nbRooms);
|
|
}
|
|
return;
|
|
LAB_00704e53:
|
|
player = player->_backupPlayer;
|
|
LAB_00704e59:
|
|
if (player == GHIDRA_CAST<Entity_Player *>(0x0)) goto LAB_00704eb0;
|
|
if (rerollSeed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
rerollSeed = rerollSeed >> 5 ^ rerollSeed;
|
|
rerollSeed = rerollSeed << 9 ^ rerollSeed;
|
|
rerollSeed = rerollSeed >> 7 ^ rerollSeed;
|
|
if (rerollSeed == (rerollSeed / 5) * 5) goto LAB_00704eb0;
|
|
goto LAB_00704d00;
|
|
LAB_00704eb0:
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(savedEntities->_begin) + entityOffset + 4)) = pickupVariant;
|
|
LAB_00704ebe:
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(savedEntities->_begin) + entityOffset + 8)) = 0;
|
|
LAB_00704ec8:
|
|
pvVar5 = savedEntities->_begin;
|
|
entityOffset = entityOffset + 0x78;
|
|
entityIndex = entityIndex + 1;
|
|
if (GHIDRA_UINT(((GHIDRA_INT(savedEntities->_end) - GHIDRA_INT(pvVar5)) / 0x78)) <= entityIndex) goto LAB_00704ef7;
|
|
goto LAB_00704ca2;
|
|
}
|
|
|
|
// 00704f20
|
|
void Game::FinishChallenge()
|
|
{
|
|
Manager *pMVar1;
|
|
byte isGameplayInputActive;
|
|
int in_stack_ffffffbc;
|
|
int unused2;
|
|
KColor fadeColor [2];
|
|
float fadeAlpha;
|
|
Game *game;
|
|
Manager *manager;
|
|
|
|
if ((this->_fadeOutColor)._alpha <= 0.0) {
|
|
if (g_game->_challenge != 0) {
|
|
isGameplayInputActive = Manager::IsGameplayInputActive(GHIDRA_INT(this));
|
|
manager = g_manager;
|
|
if (isGameplayInputActive == 0) {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("Setting PersistentGameData ReadOnly to %s\n"));
|
|
pMVar1 = g_manager;
|
|
game = g_game;
|
|
(manager->_persistentGameData)._isReadOnly = 0;
|
|
(GHIDRA_CAST<PersistentGameData *>((&pMVar1->_persistentGameData)))->PersistentGameData::AddChallenge(game->_challenge);
|
|
manager = g_manager;
|
|
in_stack_ffffffbc = 0x704fa0;
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("Setting PersistentGameData ReadOnly to %s\n"));
|
|
(manager->_persistentGameData)._isReadOnly = 1;
|
|
}
|
|
}
|
|
(g_manager->_achievementOverlay)._isPopupBlocked = 1;
|
|
DeleteSaveState();
|
|
if (g_manager->_netplayManager == *GHIDRA_CAST<NetplayManager *>((g_manager + 1))) {
|
|
(GHIDRA_CAST<KColor *>((fadeColor)))->KColor::SetFromARGB(0xff000000);
|
|
this->_fadeOutTarget = 4;
|
|
}
|
|
else {
|
|
unused2 = 0x704fd4;
|
|
FUN_0090cd10(1,0);
|
|
netplay_leave_lobby(&g_manager->_netplayManager,in_stack_ffffffbc,unused2);
|
|
(GHIDRA_CAST<KColor *>((fadeColor)))->KColor::SetFromARGB(0xff000000);
|
|
this->_fadeOutTarget = 3;
|
|
}
|
|
fadeAlpha = (this->_fadeOutColor)._alpha;
|
|
this->_fadeSpeed = 0.04;
|
|
(this->_fadeOutColor)._red = fadeColor[0]._red;
|
|
(this->_fadeOutColor)._green = fadeColor[0]._green;
|
|
(this->_fadeOutColor)._blue = fadeColor[0]._blue;
|
|
(this->_fadeOutColor)._alpha = fadeAlpha;
|
|
(this->_fadeOutColor)._unk = 0;
|
|
(this->_fadeOutColor)._alpha = (this->_fadeOutColor)._alpha + 0.04;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00705080
|
|
byte Game::AchievementUnlocksDisallowed()
|
|
{
|
|
byte bVar1;
|
|
int unusedArg;
|
|
|
|
if ((this->_seedEffects)._isCustomRun == 0) {
|
|
bVar1 = (GHIDRA_CAST<Seeds *>((&this->_seedEffects)))->Seeds::AchievementUnlocksDisallowed();
|
|
if (bVar1 == 0) {
|
|
bVar1 = Manager::IsGameplayInputActive(unusedArg);
|
|
if ((bVar1 == 0) && (this->_isRerun == 0)) {
|
|
return 0;
|
|
}
|
|
}
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 007050c0
|
|
byte Game::RerollEnemy(Entity_NPC *npc, byte isIgnoreHealthMatch)
|
|
{
|
|
Game *newNpc = this;
|
|
uint *puVar1;
|
|
float fVar2;
|
|
int iVar3;
|
|
undefined4 uVar4;
|
|
undefined4 uVar5;
|
|
undefined4 uVar6;
|
|
qword qVar7;
|
|
byte bVar8;
|
|
void **pool;
|
|
Entity_NPC *newNpc;
|
|
undefined4 *puVar9;
|
|
void *pvVar10;
|
|
undefined4 *puVar11;
|
|
uint uVar12;
|
|
undefined4 *poolEntry;
|
|
float fVar13;
|
|
float fVar14;
|
|
uint newType;
|
|
uint newVariant;
|
|
uint uStack_58;
|
|
uint uStack_54;
|
|
undefined4 local_50;
|
|
void *filteredBegin;
|
|
undefined4 *filteredEnd;
|
|
undefined4 *filteredCapacity;
|
|
int championColor;
|
|
Game *self;
|
|
undefined4 *local_38;
|
|
float healthFraction;
|
|
Vector local_30;
|
|
Vector local_28;
|
|
undefined1 *puStack_20;
|
|
void *local_1c;
|
|
undefined *puStack_18;
|
|
undefined4 local_14;
|
|
void *filteredData;
|
|
|
|
puStack_20 = GHIDRA_CAST<undefined1 *>((GHIDRA_INT(register0x00000010) + -4));
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &DAT_00afc42d;
|
|
local_1c = ExceptionList;
|
|
ExceptionList = &local_1c;
|
|
if ((npc != GHIDRA_CAST<Entity_NPC *>(0x0)) &&
|
|
(((1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager) && (npc->_type == 1)) || (npc->_type - 10U < 0x3de))
|
|
)) {
|
|
self = newNpc;
|
|
bVar8 = (GHIDRA_CAST<Entity_NPC *>((npc)))->Entity_NPC::CanReroll();
|
|
if (bVar8 != 0) {
|
|
championColor = npc->_championColorIdx;
|
|
healthFraction = 1.0;
|
|
if (0.0 < npc->_maxHitPoints) {
|
|
healthFraction = npc->_health / npc->_maxHitPoints;
|
|
if (healthFraction <= 0.0) {
|
|
healthFraction = 0.0;
|
|
}
|
|
if (1.0 <= healthFraction) {
|
|
healthFraction = 1.0;
|
|
}
|
|
}
|
|
iVar3 = npc->_entityGridCollisionClass;
|
|
if (((iVar3 == 0) || (iVar3 == 3)) || ((iVar3 == 1 || (iVar3 == 2)))) {
|
|
pool = (void **)&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((g_manager)) + 0x2a6b4)));
|
|
}
|
|
else {
|
|
pool = (void **)&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((g_manager)) + 0x2a6a8)));
|
|
}
|
|
puVar11 = GHIDRA_CAST<undefined4 *>(0x0);
|
|
local_28.y = (float)pool;
|
|
local_38 = GHIDRA_CAST<undefined4 *>(0x0);
|
|
puVar9 = GHIDRA_CAST<undefined4 *>(0x0);
|
|
filteredBegin = (void *)0x0;
|
|
filteredEnd = GHIDRA_CAST<undefined4 *>(0x0);
|
|
filteredCapacity = GHIDRA_CAST<undefined4 *>(0x0);
|
|
local_14 = 0;
|
|
fVar2 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(npc->_config) + 0x54));
|
|
local_30.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(npc->_config) + 0x50));
|
|
if (fVar2 <= 0.001) {
|
|
}
|
|
else {
|
|
fVar13 = (float)g_game->_stage;
|
|
if (10.0 <= fVar13) {
|
|
fVar13 = 10.0;
|
|
}
|
|
if (g_game->_stage < 5) {
|
|
fVar14 = 1.0;
|
|
}
|
|
else {
|
|
fVar14 = 0.8;
|
|
}
|
|
local_30.y = fVar14 * fVar13 * fVar2 + local_30.y;
|
|
}
|
|
poolEntry = *pool;
|
|
if (poolEntry != pool[1]) {
|
|
do {
|
|
if (isIgnoreHealthMatch == 0) {
|
|
fVar2 = (float)poolEntry[4];
|
|
fVar13 = (float)poolEntry[3];
|
|
if (0.001 < fVar2) {
|
|
fVar14 = (float)g_game->_stage;
|
|
if (10.0 <= fVar14) {
|
|
fVar14 = 10.0;
|
|
}
|
|
if (g_game->_stage < 5) {
|
|
fVar13 = fVar14 * 1.0 * fVar2 + fVar13;
|
|
}
|
|
else {
|
|
fVar13 = fVar14 * 0.8 * fVar2 + fVar13;
|
|
}
|
|
}
|
|
if (ABS(local_30.y - fVar13) <= 5.0) goto LAB_007052ae;
|
|
}
|
|
else {
|
|
LAB_007052ae:
|
|
if (puVar9 == puVar11) {
|
|
std::vector<20byte>::_Emplace_reallocate(puVar9,poolEntry);
|
|
puVar9 = filteredEnd;
|
|
puVar11 = filteredCapacity;
|
|
}
|
|
else {
|
|
uVar4 = poolEntry[1];
|
|
uVar5 = poolEntry[2];
|
|
uVar6 = poolEntry[3];
|
|
*puVar9 = *poolEntry;
|
|
puVar9[1] = uVar4;
|
|
puVar9[2] = uVar5;
|
|
puVar9[3] = uVar6;
|
|
puVar9[4] = poolEntry[4];
|
|
filteredEnd = puVar9 + 5;
|
|
puVar9 = puVar9 + 5;
|
|
}
|
|
}
|
|
poolEntry = poolEntry + 5;
|
|
} while (poolEntry != pool[1]);
|
|
local_38 = puVar11;
|
|
}
|
|
filteredData = filteredBegin;
|
|
iVar3 = GHIDRA_INT(puVar9) - GHIDRA_INT(filteredBegin) >> 0x1f;
|
|
pool = &filteredBegin;
|
|
if ((GHIDRA_INT(puVar9) - GHIDRA_INT(filteredBegin)) / 0x14 + iVar3 == iVar3) {
|
|
pool = (void **)local_28.y;
|
|
}
|
|
pvVar10 = *pool;
|
|
local_28.y = (float)((GHIDRA_INT(pool[1]) - GHIDRA_INT(pvVar10)) / 0x14);
|
|
local_30.y = (float)pvVar10;
|
|
if (local_28.y == 0.0) {
|
|
uVar12 = 0;
|
|
}
|
|
else {
|
|
uVar12 = Random();
|
|
pvVar10 = *pool;
|
|
uVar12 = uVar12 % GHIDRA_UINT(local_28.y);
|
|
}
|
|
puVar1 = GHIDRA_CAST<uint *>((GHIDRA_INT(pvVar10) + uVar12 * 0x14));
|
|
newType = *puVar1;
|
|
newVariant = puVar1[1];
|
|
uStack_58 = puVar1[2];
|
|
uStack_54 = puVar1[3];
|
|
local_50 = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar10) + uVar12 * 0x14 + 0x10));
|
|
Entity_NPC::Redirect(GHIDRA_CAST<int *>(&newType),GHIDRA_CAST<int *>(&newVariant));
|
|
uVar12 = Random();
|
|
local_30.x = (npc->_velocity).x;
|
|
local_30.y = (npc->_velocity).y;
|
|
local_28.x = (npc->_pos).x;
|
|
local_28.y = (npc->_pos).y;
|
|
newNpc = (Entity_NPC *)
|
|
Spawn(self,newType,newVariant,&local_28,&local_30,GHIDRA_CAST<Entity *>(0x0),0,uVar12);
|
|
if (-1 < championColor) {
|
|
(GHIDRA_CAST<Entity_NPC *>((newNpc)))->Entity_NPC::Morph(newNpc->_type,newNpc->_variant,newNpc->_subtype,championColor);
|
|
}
|
|
qVar7 = newNpc->_flags;
|
|
puVar1 = GHIDRA_CAST<uint *>((GHIDRA_INT(&newNpc->_flags) + 4));
|
|
*puVar1 = *puVar1 | 0x80;
|
|
*GHIDRA_CAST<int *>(&newNpc->_flags) = GHIDRA_INT(qVar7);
|
|
newNpc->Update();
|
|
newNpc->_health = healthFraction * newNpc->_maxHitPoints;
|
|
npc->Remove();
|
|
if (filteredData != (void *)0x0) {
|
|
uVar12 = ((GHIDRA_INT(local_38) - GHIDRA_INT(filteredData)) / 0x14) * 0x14;
|
|
pvVar10 = filteredData;
|
|
if (0xfff < uVar12) {
|
|
pvVar10 = *(void **)(GHIDRA_CAST<char *>(filteredData) + -4);
|
|
uVar12 = uVar12 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(filteredData) + (-4 - GHIDRA_INT(pvVar10))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar10,uVar12);
|
|
}
|
|
bVar8 = 1;
|
|
goto LAB_00705462;
|
|
}
|
|
}
|
|
bVar8 = 0;
|
|
LAB_00705462:
|
|
ExceptionList = local_1c;
|
|
return bVar8;
|
|
}
|
|
|
|
// 00705480
|
|
byte Game::DevolveEnemy(Entity *entity, Entity **outEntity)
|
|
{
|
|
void *pvVar1;
|
|
Room *devolved;
|
|
code *pcVar2;
|
|
char cVar3;
|
|
byte isDevolvedFlying;
|
|
uint *puVar5;
|
|
Entity *poofEffect;
|
|
EntityConfig_Entity *devolvedConfig;
|
|
Vector *reachablePos;
|
|
Entity_NPC *devolved;
|
|
byte *gridCollisionClass;
|
|
int *extraout_ECX;
|
|
std_string *devolvedGridCollisionClass;
|
|
int unused;
|
|
uint uVar6;
|
|
int iVar7;
|
|
uint gridIndex;
|
|
int iVar8;
|
|
float fVar9;
|
|
Entity **outEntity_00;
|
|
Vector local_40;
|
|
Entity **savedOutEntity;
|
|
float healthFraction;
|
|
int championColor;
|
|
Vector scratchVec;
|
|
Game *game;
|
|
uint local_20;
|
|
float local_1c;
|
|
char isFlying;
|
|
uint entryType;
|
|
Vector local_10;
|
|
undefined4 local_8;
|
|
ushort devolvedSubtype;
|
|
qword flags;
|
|
bool isDevolvedFlying;
|
|
Game *savedGame;
|
|
|
|
local_8 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
savedOutEntity = outEntity;
|
|
game = g_game;
|
|
if ((entity->_flags & 0x20000000) == 0) {
|
|
cVar3 = FUN_008667d0(entity);
|
|
if (cVar3 != '\0') {
|
|
return 1;
|
|
}
|
|
pvVar1 = entity->_config;
|
|
if (pvVar1 != (void *)0x0) {
|
|
iVar8 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0xa4));
|
|
scratchVec.y = (float)(GHIDRA_INT(pvVar1) + 0xa4);
|
|
if ((iVar8 != *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0xa8))) && (entity->_type != 0x19c)) {
|
|
healthFraction = 1.0;
|
|
championColor = -1;
|
|
isDevolvedFlying = (GHIDRA_CAST<Entity *>((entity)))->Entity::IsEnemy();
|
|
fVar9 = 0.0;
|
|
local_1c = 0.0;
|
|
if (isDevolvedFlying != 0) {
|
|
championColor = entity[3]._spawnerType;
|
|
if (0.0 < entity->_maxHitPoints) {
|
|
healthFraction = entity->_health / entity->_maxHitPoints;
|
|
if (healthFraction <= 0.0) {
|
|
healthFraction = 0.0;
|
|
}
|
|
if (1.0 <= healthFraction) {
|
|
healthFraction = 1.0;
|
|
}
|
|
}
|
|
}
|
|
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 4));
|
|
if (iVar7 == 0) {
|
|
local_20 = 0;
|
|
}
|
|
else {
|
|
local_20 = *GHIDRA_CAST<uint *>((iVar7 + 0x58));
|
|
}
|
|
local_40.y = 3.78351e-44;
|
|
local_10.y = (float)(GHIDRA_INT(pvVar1) + 0xa8);
|
|
if (iVar8 != *GHIDRA_CAST<int *>(local_10.y)) {
|
|
do {
|
|
fVar9 = fVar9 + *GHIDRA_CAST<float *>((iVar8 + 8));
|
|
iVar8 = iVar8 + 0xc;
|
|
} while (iVar8 != *GHIDRA_CAST<int *>(local_10.y));
|
|
local_1c = fVar9;
|
|
}
|
|
gridCollisionClass = GHIDRA_CAST<byte *>((GHIDRA_INT(pvVar1) + 0xb4));
|
|
if (0xf < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(pvVar1) + 200))) {
|
|
gridCollisionClass = *GHIDRA_CAST<byte **>(gridCollisionClass);
|
|
}
|
|
fVar9 = local_1c;
|
|
isDevolvedFlying = str_eq(gridCollisionClass,*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(pvVar1) + 0xc4)),GHIDRA_CAST<byte *>("ground"),6);
|
|
if ((isDevolvedFlying == 0) &&
|
|
((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0xc4)) != 0 || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x48)) < 1)))) {
|
|
isFlying = '\x01';
|
|
}
|
|
else {
|
|
isFlying = '\0';
|
|
}
|
|
if (local_20 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
isDevolvedFlying = (*pcVar2)();
|
|
return isDevolvedFlying;
|
|
}
|
|
uVar6 = local_20 >> 4 ^ local_20;
|
|
uVar6 = uVar6 << 3 ^ uVar6;
|
|
uVar6 = uVar6 >> (SUB41(local_40.y,0) & 0x1f) ^ uVar6;
|
|
fVar9 = (float)((double)GHIDRA_INT(uVar6) + __uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)]) *
|
|
2.3283062e-10 * fVar9;
|
|
for (puVar5 = *GHIDRA_CAST<uint **>(scratchVec.y); puVar5 != *GHIDRA_CAST<uint **>(local_10.y); puVar5 = puVar5 + 3) {
|
|
if (fVar9 < (float)puVar5[2]) {
|
|
uVar6 = *puVar5;
|
|
if (999 < GHIDRA_INT(uVar6)) {
|
|
devolved = game->_room;
|
|
iVar8 = GHIDRA_INT((((entity->_pos).x - 40.0) / 40.0 + 0.5));
|
|
if ((((iVar8 < 0) || (devolved->_gridWidth <= iVar8)) ||
|
|
(iVar7 = GHIDRA_INT((((entity->_pos).y - 120.0) / 40.0 + 0.5)), iVar7 < 0)) ||
|
|
(devolved->_gridHeight <= iVar7)) {
|
|
gridIndex = 0xffffffff;
|
|
}
|
|
else {
|
|
gridIndex = iVar7 * devolved->_gridWidth + iVar8;
|
|
if (gridIndex != 0xffffffff) {
|
|
isDevolvedFlying = 0;
|
|
outEntity_00 = GHIDRA_CAST<Entity **>(0x0);
|
|
local_10.x = (float)CONCAT22((*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(&(local_10.x)) + 0x2))),(short)puVar5[1]);
|
|
entryType = uVar6;
|
|
uVar6 = Random();
|
|
(GHIDRA_CAST<Room *>((devolved)))->Room::SpawnEntry(gridIndex,&entryType,uVar6,outEntity_00,isDevolvedFlying);
|
|
}
|
|
}
|
|
if ((-1 < entity->_spawnGridIndex) &&
|
|
(isDevolvedFlying = Room::IsPersistentRoomEntity
|
|
(entity->_type,entity->_variant,entity->_spawnGridIndex),
|
|
isDevolvedFlying != 0)) {
|
|
local_10.y = (float)extraout_ECX;
|
|
std::set<int>::insert(&scratchVec,&local_10.y);
|
|
}
|
|
entity->Remove();
|
|
uVar6 = Random();
|
|
iVar8 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 0xc));
|
|
local_10.x = (float)(GHIDRA_INT(gridIndex) % iVar8) * 40.0 + 40.0;
|
|
local_10.y = (float)(GHIDRA_INT(gridIndex) / iVar8) * 40.0 + 120.0;
|
|
poofEffect = Spawn(g_game,1000,0xf,&local_10,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar6);
|
|
poofEffect->Update();
|
|
if (savedOutEntity == GHIDRA_CAST<Entity **>(0x0)) {
|
|
return 1;
|
|
}
|
|
*savedOutEntity = poofEffect;
|
|
return 1;
|
|
}
|
|
if (uVar6 == 0) {
|
|
return 0;
|
|
}
|
|
local_1c = (float)GHIDRA_UINT((ushort)puVar5[1]);
|
|
devolvedSubtype = *GHIDRA_CAST<ushort *>((GHIDRA_CAST<char *>(puVar5) + 6));
|
|
if (uVar6 == 999) {
|
|
uVar6 = 1000;
|
|
}
|
|
local_20 = uVar6;
|
|
local_10.y = (float)GHIDRA_UINT(devolvedSubtype);
|
|
Entity_NPC::Redirect(GHIDRA_CAST<int *>(&local_20),GHIDRA_CAST<int *>(&local_1c));
|
|
devolvedConfig =
|
|
EntityConfig::GetEntity
|
|
(&g_manager->_entityConfig,local_20,GHIDRA_INT(local_1c),GHIDRA_UINT(devolvedSubtype));
|
|
if (devolvedConfig != GHIDRA_CAST<EntityConfig_Entity *>(0x0)) {
|
|
devolvedGridCollisionClass = &devolvedConfig->gridCollisionClassString;
|
|
if (0xf < (devolvedConfig->gridCollisionClassString)._capacity) {
|
|
devolvedGridCollisionClass = *GHIDRA_CAST<std_string **>(devolvedGridCollisionClass->_buf);
|
|
}
|
|
isDevolvedFlying = str_eq(GHIDRA_CAST<byte *>(devolvedGridCollisionClass),
|
|
(devolvedConfig->gridCollisionClassString)._size,GHIDRA_CAST<byte *>("ground"),6);
|
|
if ((isDevolvedFlying == 0) &&
|
|
(((devolvedConfig->gridCollisionClassString)._size != 0 ||
|
|
(devolvedConfig->gridCollisionPoints < 1)))) {
|
|
isDevolvedFlying = true;
|
|
goto LAB_00705880;
|
|
}
|
|
}
|
|
isDevolvedFlying = false;
|
|
LAB_00705880:
|
|
savedGame = game;
|
|
if ((isFlying != '\0') && (!isDevolvedFlying)) {
|
|
scratchVec.x = (entity->_pos).x;
|
|
scratchVec.y = (entity->_pos).y;
|
|
cVar3 = Room::is_reachable_from_player(&scratchVec,0,0);
|
|
if (cVar3 == '\0') {
|
|
scratchVec.x = (entity->_pos).x;
|
|
scratchVec.y = (entity->_pos).y;
|
|
reachablePos = Room::find_reachable_position
|
|
(savedGame->_room,&local_40,&scratchVec,unused);
|
|
(entity->_pos).x = reachablePos->x;
|
|
(entity->_pos).y = reachablePos->y;
|
|
(entity->_velocity).x = g_vectorZero.x;
|
|
(entity->_velocity).y = g_vectorZero.y;
|
|
}
|
|
}
|
|
uVar6 = Random();
|
|
scratchVec.x = (entity->_velocity).x;
|
|
scratchVec.y = (entity->_velocity).y;
|
|
local_40.x = (entity->_pos).x;
|
|
local_40.y = (entity->_pos).y;
|
|
devolved = (Entity_NPC *)
|
|
Spawn(game,local_20,GHIDRA_UINT(local_1c),&local_40,&scratchVec,GHIDRA_CAST<Entity *>(0x0),
|
|
GHIDRA_UINT(local_10.y),uVar6);
|
|
isDevolvedFlying = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(devolved))))->Entity::IsEnemy();
|
|
if (isDevolvedFlying != 0) {
|
|
if (-1 < championColor) {
|
|
(GHIDRA_CAST<Entity_NPC *>((devolved)))->Entity_NPC::Morph(devolved->_type,devolved->_variant,devolved->_subtype,
|
|
championColor);
|
|
}
|
|
fVar9 = devolved->_maxHitPoints;
|
|
flags = devolved->_flags;
|
|
puVar5 = GHIDRA_CAST<uint *>((GHIDRA_INT(&devolved->_flags) + 4));
|
|
*puVar5 = *puVar5 | 0x80;
|
|
*GHIDRA_CAST<int *>(&devolved->_flags) = GHIDRA_INT(flags);
|
|
devolved->_health = healthFraction * fVar9;
|
|
}
|
|
devolved->Update();
|
|
devolved->_spawnGridIndex = entity->_spawnGridIndex;
|
|
if (savedOutEntity != GHIDRA_CAST<Entity **>(0x0)) {
|
|
*savedOutEntity = GHIDRA_CAST<Entity *>(devolved);
|
|
}
|
|
entity->Remove();
|
|
return 1;
|
|
}
|
|
fVar9 = fVar9 - (float)puVar5[2];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 007059f0
|
|
void Game::ShowHallucination(int param_2, int param_3)
|
|
{
|
|
uint uVar1;
|
|
int iVar2;
|
|
int soundId;
|
|
Game *local_c;
|
|
Game *game;
|
|
Manager *manager;
|
|
void *room;
|
|
int *roomEntity;
|
|
|
|
manager = g_manager;
|
|
soundId = 0x21;
|
|
if (param_3 < 1) {
|
|
param_3 = 0;
|
|
}
|
|
iVar2 = 0x3f;
|
|
if (param_3 < 0x3f) {
|
|
iVar2 = param_3;
|
|
}
|
|
this->_hallucinationDuration = param_2;
|
|
this->_hallucinationTimer = param_2;
|
|
local_c = this;
|
|
seed_fart_sound_override(&soundId);
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(soundId,3.0,2,0,0.5,0.0);
|
|
if (((iVar2 != 0) && (room = this->_room, *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 0x1d18)) != 0x12)) &&
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 8)) != 0x10)) {
|
|
if (iVar2 == 0x3f) {
|
|
uVar1 = Random();
|
|
iVar2 = *GHIDRA_CAST<int *>((&DAT_00b67fb0 + (uVar1 & 0xf) * 4));
|
|
room = local_c->_room;
|
|
}
|
|
uVar1 = 0;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 0x1264)) != 0) {
|
|
do {
|
|
roomEntity = *GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 0x125c)) + uVar1 * 4));
|
|
if ((roomEntity[0x5b] & 0x40U) != 0) {
|
|
(**(code **)(*roomEntity + 0x28))();
|
|
}
|
|
uVar1 = uVar1 + 1;
|
|
} while (uVar1 < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(room) + 0x1264)));
|
|
room = local_c->_room;
|
|
}
|
|
game = g_game;
|
|
if ((iVar2 < 0) || (0x3e < iVar2)) {
|
|
iVar2 = 1;
|
|
}
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 0x1d18)) = iVar2;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(room) + 0x6ae0)) = 0x42500000;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(room) + 0x6ae4)) = 0x42500000;
|
|
iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 0x10));
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(room) + 0x6ae8)) = (float)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 0xc)) + -2) * 26.0 + 52.0;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(room) + 0x6aec)) = (float)(iVar2 + -2) * 26.0 + 52.0;
|
|
(GHIDRA_CAST<Backdrop *>((GHIDRA_CAST<Backdrop *>((GHIDRA_INT(room) + 0x1bc8)))))->Backdrop::load_details();
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00705ee0
|
|
void Game::save_rewind_state(int leaveDoor)
|
|
{
|
|
GlowingHourglassState *hourglassState;
|
|
int *dstCounter;
|
|
int iVar1;
|
|
int *srcCounter;
|
|
int iVar2;
|
|
Game *game;
|
|
bool isSameRoom;
|
|
Manager *manager;
|
|
undefined4 savedField44;
|
|
|
|
game = g_game;
|
|
if (((g_game->_isStoringGlowingHourglassState == 0) &&
|
|
(g_game->_isRestoringGlowingHourglassState == 0)) && (g_game->_isPocketItemRewindSaved == 0))
|
|
{
|
|
iVar2 = g_game->_currentGlowingHourglassSlot;
|
|
isSameRoom = false;
|
|
iVar1 = 0;
|
|
if ((-1 < iVar2) &&
|
|
(hourglassState = g_game->_glowingHourglassStates + iVar2, hourglassState->_isUsable != 0)) {
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((hourglassState->_gameState))) + 0x19d1c)))) == g_game->_currentRoomIdx) &&
|
|
(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((hourglassState->_gameState))) + 0xe4)))) == g_game->_stage)) {
|
|
isSameRoom = true;
|
|
iVar1 = iVar2;
|
|
if (-1 < leaveDoor) {
|
|
if (leaveDoor == hourglassState->_leaveDoor) {
|
|
return;
|
|
}
|
|
if ((-1 < hourglassState->_leaveDoor) &&
|
|
(GHIDRA_UINT((g_game->_frameCount - hourglassState->_timeCounter)) < 0xf)) {
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
iVar1 = 1 - iVar2;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((hourglassState->_gameState))) + 0x19d50)))) = g_game->_leaveDoor;
|
|
}
|
|
}
|
|
game->_currentGlowingHourglassSlot = iVar1;
|
|
game->_isStoringGlowingHourglassState = 1;
|
|
hourglassState = game->_glowingHourglassStates + iVar1;
|
|
savedField44 = *GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((hourglassState->_gameState))) + 0x44))));
|
|
store_game_state(game,&hourglassState->_gameState);
|
|
if (isSameRoom) {
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((hourglassState->_gameState))) + 0x44)))) = savedField44;
|
|
}
|
|
manager = g_manager;
|
|
dstCounter = hourglassState->_eventCounters;
|
|
hourglassState->_isUsable = 1;
|
|
srcCounter = (manager->_persistentGameData)._eventCounters;
|
|
hourglassState->_leaveDoor = leaveDoor;
|
|
hourglassState->_timeCounter = game->_frameCount;
|
|
iVar2 = 0x20b;
|
|
do {
|
|
iVar1 = *srcCounter;
|
|
srcCounter = srcCounter + 1;
|
|
*dstCounter = iVar1;
|
|
dstCounter = dstCounter + 1;
|
|
iVar2 = iVar2 + -1;
|
|
} while (iVar2 != 0);
|
|
game->_isStoringGlowingHourglassState = 0;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00706020
|
|
void Game::rewind(Entity_Player *player)
|
|
{
|
|
int iVar1;
|
|
int iVar2;
|
|
PlayerManager *pPVar3;
|
|
char extraout_AL;
|
|
uint uVar4;
|
|
GlowingHourglassState *hourglassState;
|
|
Entity_Player *pEVar5;
|
|
int iVar6;
|
|
void *pvVar7;
|
|
byte bVar8;
|
|
void *pvVar9;
|
|
Game *game;
|
|
int *playerIt;
|
|
uint uVar10;
|
|
uint uVar11;
|
|
PlayerManager *hourglassWispCount;
|
|
int *piVar12;
|
|
Room *this;
|
|
int *playerQueueProxy;
|
|
void *playerQueueMap;
|
|
uint playerQueueMapSize;
|
|
uint playerQueueOffset;
|
|
int playerQueueSize;
|
|
void **roomPtr;
|
|
uint local_3c;
|
|
Vector local_38;
|
|
Game *local_30;
|
|
GlowingHourglassState *local_2c;
|
|
void *local_28;
|
|
uint local_24;
|
|
PlayerManager *local_20;
|
|
int *local_1c;
|
|
char isHasMoreOptions;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
GlowingHourglassState *savedState;
|
|
void **temp_3f74d4d66a;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00afc45d;
|
|
local_10 = ExceptionList;
|
|
uVar4 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
local_30 = g_game;
|
|
iVar6 = g_game->_currentGlowingHourglassSlot;
|
|
if (iVar6 < 0) {
|
|
return;
|
|
}
|
|
hourglassState = GHIDRA_CAST<GlowingHourglassState *>((GHIDRA_INT(g_game) + iVar6 * -0x20660 + 0x4704c));
|
|
bVar8 = hourglassState->_isUsable;
|
|
if (bVar8 == 0) {
|
|
hourglassState = g_game->_glowingHourglassStates + iVar6;
|
|
bVar8 = hourglassState->_isUsable;
|
|
}
|
|
local_2c = GHIDRA_CAST<GlowingHourglassState *>(0x0);
|
|
if (bVar8 != 0) {
|
|
local_2c = hourglassState;
|
|
}
|
|
if (local_2c == GHIDRA_CAST<GlowingHourglassState *>(0x0)) {
|
|
return;
|
|
}
|
|
roomPtr = &g_game->_room;
|
|
hourglassWispCount = GHIDRA_CAST<PlayerManager *>(0x0);
|
|
local_28 = *roomPtr;
|
|
local_1c = GHIDRA_CAST<int *>(0x0);
|
|
local_24 = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(local_28) + 0x1264)) - 1;
|
|
ExceptionList = &local_10;
|
|
if (local_24 < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(local_28) + 0x1264))) {
|
|
game = g_game;
|
|
do {
|
|
pEVar5 = *GHIDRA_CAST<Entity_Player **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_28) + 0x125c)) + local_24 * 4));
|
|
iVar6 = pEVar5->_type;
|
|
if ((pEVar5 == GHIDRA_CAST<Entity_Player *>(0x0)) || (iVar6 != 3)) {
|
|
local_1c = &pEVar5->_type;
|
|
local_20 = hourglassWispCount;
|
|
if ((iVar6 == 3) ||
|
|
((((1 < *GHIDRA_CAST<int *>(&game->_deathmatchManager) && (iVar6 == 1)) || (iVar6 - 10U < 0x3de)) &&
|
|
((pEVar5->_flags & 0x20000000) != 0)))) goto LAB_00706148;
|
|
}
|
|
else {
|
|
if (((pEVar5->_variant == 0xce) && (pEVar5->_subtype == 0x1a6)) &&
|
|
(game->_frameCount - pEVar5->_spawnFrame < 2)) {
|
|
hourglassWispCount = GHIDRA_CAST<PlayerManager *>((GHIDRA_INT(hourglassWispCount) + 1));
|
|
}
|
|
local_20 = hourglassWispCount;
|
|
LAB_00706148:
|
|
hourglassWispCount = local_20;
|
|
local_1c = &pEVar5->_type;
|
|
pEVar5->ClearReferences(uVar4);
|
|
pvVar7 = g_game->_room;
|
|
(GHIDRA_CAST<EntityList_EL *>((GHIDRA_CAST<EntityList_EL *>((GHIDRA_INT(pvVar7) + 0x1238)))))->EntityList_EL::remove(GHIDRA_CAST<Entity *>(pEVar5));
|
|
(GHIDRA_CAST<EntityList_EL *>((GHIDRA_CAST<EntityList_EL *>((GHIDRA_INT(pvVar7) + 0x1258)))))->EntityList_EL::remove(GHIDRA_CAST<Entity *>(pEVar5));
|
|
(GHIDRA_CAST<EntityList_EL *>((GHIDRA_CAST<EntityList_EL *>((GHIDRA_INT(pvVar7) + 0x1248)))))->EntityList_EL::remove(GHIDRA_CAST<Entity *>(pEVar5));
|
|
(GHIDRA_CAST<EntityList_EL *>((GHIDRA_CAST<EntityList_EL *>((GHIDRA_INT(pvVar7) + 0x1268)))))->EntityList_EL::remove(GHIDRA_CAST<Entity *>(pEVar5));
|
|
(GHIDRA_CAST<EntityList_EL *>((GHIDRA_CAST<EntityList_EL *>((GHIDRA_INT(pvVar7) + 0x12a8)))))->EntityList_EL::remove(GHIDRA_CAST<Entity *>(pEVar5));
|
|
pEVar5->_valid = 0;
|
|
EntityList::invalidate_type_cache
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(pvVar7) + 0x1218)),pEVar5->_type,pEVar5->_variant,
|
|
pEVar5->_subtype);
|
|
iVar6 = *local_1c;
|
|
game = g_game;
|
|
}
|
|
pPVar3 = local_20;
|
|
if ((iVar6 == 1) && (pEVar5->_parent != (EntityPtr)0x0)) {
|
|
(GHIDRA_CAST<PlayerManager *>((&game->_playerManager)))->PlayerManager::RemoveCoPlayer(pEVar5,(byte)&game->_playerManager);
|
|
game = g_game;
|
|
}
|
|
local_24 = local_24 - 1;
|
|
} while (local_24 < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(local_28) + 0x1264)));
|
|
local_1c = GHIDRA_CAST<int *>(pPVar3);
|
|
}
|
|
hourglassState = local_2c;
|
|
game = local_30;
|
|
local_24 = 0;
|
|
local_38.y = 0.0;
|
|
if (player != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
local_24 = player->_effectiveSoulCharge;
|
|
local_38.y = (float)player->_effectiveBloodCharge;
|
|
}
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((local_2c->_gameState))) + 0xe4)))) != local_30->_stage) ||
|
|
(local_28 = (void *)(GHIDRA_UINT(local_28) & 0xffffff00),
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((local_2c->_gameState))) + 0xe8)))) != local_30->_stageType)) {
|
|
local_28 = (void *)CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_28)) + 0x1))),1);
|
|
}
|
|
local_3c = local_30->_rewindsThisFloor;
|
|
local_20 = GHIDRA_CAST<PlayerManager *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(local_30))))->Level)::GetRoomByIdx(local_30->_currentRoomIdx,-1);
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_INT((GHIDRA_CAST<RoomDescriptor *>(local_20))->Data) + 8)) == 4) &&
|
|
((GHIDRA_CAST<RoomDescriptor *>(local_20))->VisitedCount == 1)) {
|
|
pEVar5 = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x19e,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
|
|
isHasMoreOptions = pEVar5 != GHIDRA_CAST<Entity_Player *>(0x0);
|
|
if ((((g_game->_stage == 10) &&
|
|
((((g_game->_stageType == 0 &&
|
|
(pEVar5 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::FirstTrinketOwner(0xa1),
|
|
pEVar5 != GHIDRA_CAST<Entity_Player *>(0x0))) &&
|
|
(iVar6 = (GHIDRA_CAST<Entity_Player *>((pEVar5)))->Entity_Player::GetTrinketMultiplier(0xa1), 1 < iVar6)) ||
|
|
(((g_game->_stage == 10 && (g_game->_stageType == 1)) &&
|
|
((pEVar5 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::FirstTrinketOwner(0x9b),
|
|
pEVar5 != GHIDRA_CAST<Entity_Player *>(0x0) &&
|
|
(iVar6 = (GHIDRA_CAST<Entity_Player *>((pEVar5)))->Entity_Player::GetTrinketMultiplier(0x9b), 1 < iVar6)))))))) ||
|
|
((((g_game->_stage == 7 || (g_game->_stage == 8)) &&
|
|
(pEVar5 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::FirstTrinketOwner(0x6f),
|
|
pEVar5 != GHIDRA_CAST<Entity_Player *>(0x0))) &&
|
|
(iVar6 = (GHIDRA_CAST<Entity_Player *>((pEVar5)))->Entity_Player::GetTrinketMultiplier(0x6f), 1 < iVar6)))) ||
|
|
(isHasMoreOptions != '\0')) {
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(*(void **)(GHIDRA_CAST<char *>(local_20) + 0x10)) + 0x34)) = 0x3f800000;
|
|
}
|
|
}
|
|
game->_isRestoringGlowingHourglassState = 1;
|
|
restore_game_state(game,&hourglassState->_gameState,0);
|
|
local_20 = &game->_playerManager;
|
|
(GHIDRA_CAST<PlayerManager *>((local_20)))->PlayerManager::remove_coplayers_without_device();
|
|
savedState = local_2c;
|
|
game->_isRestoringGlowingHourglassState = 0;
|
|
if (game->_glowingHourglassStates == hourglassState) {
|
|
game->_currentGlowingHourglassSlot = 0;
|
|
}
|
|
else {
|
|
game->_glowingHourglassStates[0]._isUsable = 0;
|
|
}
|
|
if (game->_glowingHourglassStates + 1 == hourglassState) {
|
|
game->_currentGlowingHourglassSlot = 1;
|
|
}
|
|
else {
|
|
game->_glowingHourglassStates[1]._isUsable = 0;
|
|
}
|
|
iVar6 = 0;
|
|
uVar4 = 700;
|
|
do {
|
|
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(savedState->_eventCounters) + (uVar4 - 700)));
|
|
iVar2 = *GHIDRA_CAST<int *>(((g_manager->_persistentGameData)._achievements + (uVar4 - 0x38)));
|
|
if (iVar2 != iVar1) {
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::IncreaseEventCounter(iVar6,iVar1 - iVar2);
|
|
}
|
|
piVar12 = local_1c;
|
|
uVar4 = uVar4 + 4;
|
|
iVar6 = iVar6 + 1;
|
|
} while (uVar4 < 0xae8);
|
|
local_30->_rewindsThisFloor = local_3c + 1;
|
|
if (player != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
local_30 = GHIDRA_CAST<Game *>(CONCAT31((int3)(local_3c + 1 >> 8),1));
|
|
playerQueueProxy = GHIDRA_CAST<int *>(0x0);
|
|
local_2c = GHIDRA_CAST<GlowingHourglassState *>(CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_2c)) + 0x1))),1));
|
|
playerQueueMap = (void *)0x0;
|
|
playerQueueMapSize = 0;
|
|
playerQueueOffset = 0;
|
|
playerQueueSize = 0;
|
|
playerQueueProxy = operator_new(8);
|
|
playerQueueProxy[1] = 0;
|
|
*playerQueueProxy = GHIDRA_INT(&playerQueueProxy);
|
|
local_8 = 0;
|
|
pvVar7 = (local_20->_playerList)._end;
|
|
playerIt = (local_20->_playerList)._begin;
|
|
iVar6 = playerQueueSize;
|
|
if (GHIDRA_INT(pvVar7) - GHIDRA_INT(playerIt) >> 2 != 0) {
|
|
uVar4 = 0;
|
|
do {
|
|
if (GHIDRA_INT(pvVar7) - GHIDRA_INT(playerIt) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
pvVar7 = (local_20->_playerList)._end;
|
|
playerIt = (local_20->_playerList)._begin;
|
|
iVar6 = playerQueueSize;
|
|
}
|
|
if (uVar4 < GHIDRA_UINT((GHIDRA_INT(pvVar7) - GHIDRA_INT(playerIt) >> 2))) {
|
|
playerIt = playerIt + uVar4;
|
|
}
|
|
iVar1 = *playerIt;
|
|
iVar2 = playerQueueSize;
|
|
if ((*GHIDRA_CAST<int *>((iVar1 + 0x2c)) == 0) && (*GHIDRA_CAST<int *>((iVar1 + 0x3bc)) == 0)) {
|
|
if (((playerQueueOffset + iVar6 & 3) == 0) && (playerQueueMapSize <= iVar6 + 4U >> 2)) {
|
|
std::deque<4byte>::_Growmap(playerQueueOffset);
|
|
iVar6 = playerQueueSize;
|
|
}
|
|
playerQueueOffset = playerQueueOffset & playerQueueMapSize * 4 - 1;
|
|
local_3c = playerQueueOffset + iVar6;
|
|
uVar10 = playerQueueMapSize - 1 & local_3c >> 2;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(playerQueueMap) + uVar10 * 4)) == 0) {
|
|
pvVar7 = operator_new(0x10);
|
|
*(void **)(GHIDRA_CAST<char *>(playerQueueMap) + uVar10 * 4) = pvVar7;
|
|
}
|
|
*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(playerQueueMap) + uVar10 * 4)) + (local_3c & 3) * 4)) = iVar1;
|
|
iVar6 = playerQueueSize + 1;
|
|
local_3c = *GHIDRA_CAST<int *>((iVar1 + 0x1e6c));
|
|
iVar2 = iVar6;
|
|
if (local_3c != 0) {
|
|
if (((playerQueueOffset + iVar6 & 3) == 0) &&
|
|
(playerQueueMapSize <= playerQueueSize + 5U >> 2)) {
|
|
playerQueueSize = iVar6;
|
|
std::deque<4byte>::_Growmap(playerQueueOffset);
|
|
iVar6 = playerQueueSize;
|
|
}
|
|
playerQueueSize = iVar6;
|
|
playerQueueOffset = playerQueueOffset & playerQueueMapSize * 4 - 1;
|
|
uVar10 = playerQueueOffset + playerQueueSize;
|
|
uVar11 = playerQueueMapSize - 1 & uVar10 >> 2;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(playerQueueMap) + uVar11 * 4)) == 0) {
|
|
pvVar7 = operator_new(0x10);
|
|
*(void **)(GHIDRA_CAST<char *>(playerQueueMap) + uVar11 * 4) = pvVar7;
|
|
}
|
|
*GHIDRA_CAST<uint *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(playerQueueMap) + uVar11 * 4)) + (uVar10 & 3) * 4)) = local_3c;
|
|
iVar6 = playerQueueSize + 1;
|
|
iVar2 = iVar6;
|
|
}
|
|
}
|
|
playerQueueSize = iVar2;
|
|
uVar4 = uVar4 + 1;
|
|
playerIt = (local_20->_playerList)._begin;
|
|
pvVar7 = (local_20->_playerList)._end;
|
|
piVar12 = local_1c;
|
|
} while (uVar4 < GHIDRA_UINT((GHIDRA_INT(pvVar7) - GHIDRA_INT(playerIt) >> 2)));
|
|
}
|
|
while (iVar6 != 0) {
|
|
uVar4 = playerQueueOffset >> 2;
|
|
uVar10 = playerQueueOffset & 3;
|
|
playerQueueSize = iVar6 + -1;
|
|
if (playerQueueSize == 0) {
|
|
playerQueueOffset = 0;
|
|
}
|
|
else {
|
|
playerQueueOffset = playerQueueOffset + 1;
|
|
}
|
|
Entity_Player::TryDecreaseGlowingHourglassUses
|
|
(*(Entity_Player **)
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(playerQueueMap) + (playerQueueMapSize - 1 & uVar4) * 4)) + uVar10 * 4
|
|
),GHIDRA_INT(local_2c),(byte)local_28);
|
|
local_30 = GHIDRA_CAST<Game *>((GHIDRA_UINT(local_30) & 0xff));
|
|
if (extraout_AL != '\0') {
|
|
local_30 = GHIDRA_CAST<Game *>(0x0);
|
|
}
|
|
local_2c = GHIDRA_CAST<GlowingHourglassState *>(CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_2c)) + 0x1))),(char)local_30));
|
|
iVar6 = playerQueueSize;
|
|
}
|
|
player->_effectiveSoulCharge = local_24;
|
|
player->_effectiveBloodCharge = GHIDRA_INT(local_38.y);
|
|
iVar6 = 0;
|
|
if (0 < GHIDRA_INT(piVar12)) {
|
|
do {
|
|
local_38.x = (player->_pos).x;
|
|
local_38.y = (player->_pos).y;
|
|
Entity_Player::AddWisp(player,0x1a6,&local_38,0,0);
|
|
piVar12 = GHIDRA_CAST<int *>((GHIDRA_INT(piVar12) + -1));
|
|
} while (piVar12 != GHIDRA_CAST<int *>(0x0));
|
|
iVar6 = playerQueueSize;
|
|
}
|
|
local_8 = 0xffffffff;
|
|
if (iVar6 != 0) {
|
|
do {
|
|
iVar6 = iVar6 + -1;
|
|
} while (iVar6 != 0);
|
|
playerQueueOffset = 0;
|
|
playerQueueSize = 0;
|
|
}
|
|
pvVar7 = playerQueueMap;
|
|
uVar4 = playerQueueMapSize;
|
|
if (playerQueueMapSize != 0) {
|
|
do {
|
|
pvVar9 = *(void **)(GHIDRA_CAST<char *>(pvVar7) + uVar4 * 4 + -4);
|
|
uVar4 = uVar4 - 1;
|
|
if (pvVar9 != (void *)0x0) {
|
|
operator_delete(pvVar9,0x10);
|
|
pvVar7 = playerQueueMap;
|
|
}
|
|
} while (uVar4 != 0);
|
|
}
|
|
if (pvVar7 != (void *)0x0) {
|
|
uVar4 = playerQueueMapSize * 4;
|
|
pvVar9 = pvVar7;
|
|
if (0xfff < uVar4) {
|
|
pvVar9 = *(void **)(GHIDRA_CAST<char *>(pvVar7) + -4);
|
|
uVar4 = uVar4 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(pvVar7) + (-4 - GHIDRA_INT(pvVar9))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar9,uVar4);
|
|
}
|
|
piVar12 = playerQueueProxy;
|
|
playerQueueMapSize = 0;
|
|
playerQueueMap = (void *)0x0;
|
|
playerQueueProxy = GHIDRA_CAST<int *>(0x0);
|
|
operator_delete(piVar12,8);
|
|
}
|
|
temp_3f74d4d66a = roomPtr;
|
|
uVar4 = 0;
|
|
pvVar7 = *roomPtr;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar7) + 0x1264)) != 0) {
|
|
do {
|
|
(**(code **)(**GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar7) + 0x125c)) + uVar4 * 4)) + 0x2c))();
|
|
uVar4 = uVar4 + 1;
|
|
} while (uVar4 < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(pvVar7) + 0x1264)));
|
|
}
|
|
(GHIDRA_CAST<PlayerManager *>((local_20)))->PlayerManager::enter_level();
|
|
(GHIDRA_CAST<PlayerManager *>((local_20)))->PlayerManager::trigger_new_room_effects();
|
|
this = *temp_3f74d4d66a;
|
|
uVar4 = 0;
|
|
if ((this->_entityList)._updateEL._size != 0) {
|
|
do {
|
|
(**(code **)(**GHIDRA_CAST<int **>((GHIDRA_INT((this->_entityList)._updateEL._data) + uVar4 * 4)) + 0x30))();
|
|
uVar4 = uVar4 + 1;
|
|
} while (uVar4 < GHIDRA_UINT((this->_entityList)._updateEL._size));
|
|
this = *temp_3f74d4d66a;
|
|
}
|
|
this->Room::Update();
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00706780
|
|
GlowingHourglassState * Game::GetGlowingHourglassState()
|
|
{
|
|
GlowingHourglassState *result;
|
|
GlowingHourglassState *state;
|
|
byte isUsable;
|
|
int slot;
|
|
|
|
slot = this->_currentGlowingHourglassSlot;
|
|
if (slot < 0) {
|
|
return GHIDRA_CAST<GlowingHourglassState *>(0x0);
|
|
}
|
|
state = GHIDRA_CAST<GlowingHourglassState *>((GHIDRA_INT(this) + slot * -0x20660 + 0x4704c));
|
|
isUsable = state->_isUsable;
|
|
if (isUsable == 0) {
|
|
state = this->_glowingHourglassStates + slot;
|
|
isUsable = state->_isUsable;
|
|
}
|
|
result = GHIDRA_CAST<GlowingHourglassState *>(0x0);
|
|
if (isUsable != 0) {
|
|
result = state;
|
|
}
|
|
return result;
|
|
}
|
|
|
|
// 007067c0
|
|
void Game::SetColorModifier(ColorModState *color, byte lerp, float rate)
|
|
{
|
|
float fVar1;
|
|
float fVar2;
|
|
float fVar3;
|
|
float currentAmount;
|
|
float currentBlue;
|
|
float currentBrightness;
|
|
float currentContrast;
|
|
float currentRed;
|
|
Game *game;
|
|
float targetBlue;
|
|
float targetRed;
|
|
|
|
game = g_game;
|
|
fVar1 = color->_green;
|
|
fVar2 = color->_blue;
|
|
fVar3 = color->_amount;
|
|
(g_game->_targetColorModifier)._red = color->_red;
|
|
(game->_targetColorModifier)._green = fVar1;
|
|
(game->_targetColorModifier)._blue = fVar2;
|
|
(game->_targetColorModifier)._amount = fVar3;
|
|
fVar1 = color->_contrast;
|
|
(game->_targetColorModifier)._brightness = color->_brightness;
|
|
(game->_targetColorModifier)._contrast = fVar1;
|
|
if (lerp == 0) {
|
|
fVar1 = (game->_targetColorModifier)._green;
|
|
fVar2 = (game->_targetColorModifier)._blue;
|
|
fVar3 = (game->_targetColorModifier)._amount;
|
|
(game->_currentColorModifier)._red = (game->_targetColorModifier)._red;
|
|
(game->_currentColorModifier)._green = fVar1;
|
|
(game->_currentColorModifier)._blue = fVar2;
|
|
(game->_currentColorModifier)._amount = fVar3;
|
|
fVar1 = (game->_targetColorModifier)._contrast;
|
|
(game->_currentColorModifier)._brightness = (game->_targetColorModifier)._brightness;
|
|
(game->_currentColorModifier)._contrast = fVar1;
|
|
game->_shouldLerpColorModState = 0;
|
|
return;
|
|
}
|
|
fVar1 = (game->_targetColorModifier)._contrast;
|
|
fVar2 = (game->_targetColorModifier)._brightness;
|
|
fVar3 = (game->_targetColorModifier)._amount;
|
|
targetBlue = (game->_targetColorModifier)._blue;
|
|
targetRed = (game->_targetColorModifier)._red;
|
|
currentContrast = (game->_currentColorModifier)._contrast;
|
|
currentBrightness = (game->_currentColorModifier)._brightness;
|
|
currentAmount = (game->_currentColorModifier)._amount;
|
|
currentBlue = (game->_currentColorModifier)._blue;
|
|
currentRed = (game->_currentColorModifier)._red;
|
|
(game->_lerpColorModifier)._green =
|
|
ABS((game->_targetColorModifier)._green - (game->_currentColorModifier)._green) * rate;
|
|
(game->_lerpColorModifier)._blue = ABS(targetBlue - currentBlue) * rate;
|
|
(game->_lerpColorModifier)._red = ABS(targetRed - currentRed) * rate;
|
|
(game->_lerpColorModifier)._amount = ABS(fVar3 - currentAmount) * rate;
|
|
(game->_lerpColorModifier)._brightness = ABS(fVar2 - currentBrightness) * rate;
|
|
(game->_lerpColorModifier)._contrast = ABS(fVar1 - currentContrast) * rate;
|
|
game->_shouldLerpColorModState = 1;
|
|
return;
|
|
}
|
|
|
|
// 00706940
|
|
ChallengeParam * Game::GetChallengeParams()
|
|
{
|
|
uint challengeIndex;
|
|
uint clampedIndex;
|
|
void *paramsBegin;
|
|
|
|
if ((this->_dailyChallenge)._id != 0) {
|
|
return &(this->_dailyChallenge)._params;
|
|
}
|
|
paramsBegin = (g_manager->_challengeParams)._begin;
|
|
clampedIndex = (GHIDRA_INT((g_manager->_challengeParams)._end) - GHIDRA_INT(paramsBegin)) / 0xa4 - 1;
|
|
challengeIndex = -GHIDRA_UINT((this->_challenge != 0)) & this->_challenge;
|
|
if (challengeIndex < clampedIndex) {
|
|
clampedIndex = challengeIndex;
|
|
}
|
|
return GHIDRA_CAST<ChallengeParam *>((clampedIndex * 0xa4 + GHIDRA_INT(paramsBegin)));
|
|
}
|
|
|
|
// 00707370
|
|
Entity * Game::GetNearestEnemy(Vector *position, Entity *source, float radius, void *distanceFn)
|
|
{
|
|
byte bVar1;
|
|
char cVar2;
|
|
uint uVar3;
|
|
uint uVar4;
|
|
uint uVar5;
|
|
Entity *entity;
|
|
int entityType;
|
|
bool isSpecialTarget;
|
|
float10 customDist;
|
|
float dy;
|
|
float distSq;
|
|
EntityRef entityRef;
|
|
float local_38;
|
|
void *local_30;
|
|
int local_28;
|
|
uint i;
|
|
float bestDistSq;
|
|
Vector *pos;
|
|
Entity *local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 uStack_8;
|
|
|
|
uStack_8 = 0xffffffff;
|
|
puStack_c = &LAB_00afc4c0;
|
|
local_10 = ExceptionList;
|
|
uVar3 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
ExceptionList = &local_10;
|
|
bestDistSq = radius * radius;
|
|
local_14 = GHIDRA_CAST<Entity *>(0x0);
|
|
i = 0;
|
|
local_30 = g_game->_room;
|
|
entity = GHIDRA_CAST<Entity *>(0x0);
|
|
pos = position;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_30) + 0x1264)) != 0) {
|
|
do {
|
|
entity = *GHIDRA_CAST<Entity **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_30) + 0x125c)) + i * 4));
|
|
if (((entity->_type == 1) && (source != GHIDRA_CAST<Entity *>(0x0))) &&
|
|
(bVar1 = (GHIDRA_CAST<Entity *>((source)))->Entity::HasEntityFlags(0x20000000), bVar1 != 0)) {
|
|
entityRef._variant = entity->_variant;
|
|
entityRef._position.x = (entity->_pos).x;
|
|
entityRef._position.y = (entity->_pos).y;
|
|
entityRef._spawnerType = entity->_spawnerType;
|
|
entityRef._spawnerVariant = entity->_spawnerVariant;
|
|
entityRef._velocity.x = (entity->_velocity).x;
|
|
entityRef._velocity.y = (entity->_velocity).y;
|
|
entityRef._type = 1;
|
|
if ((entity->_flags & 0x20000000) == 0) {
|
|
uVar5 = 0;
|
|
}
|
|
else {
|
|
uVar5 = 2;
|
|
}
|
|
if ((entity->_flags & 0x40000000000000) == 0) {
|
|
uVar4 = 0;
|
|
}
|
|
else {
|
|
uVar4 = 4;
|
|
}
|
|
entityRef._flags = uVar4 | uVar5 | GHIDRA_UINT(((entity->_flags & 0x100) != 0));
|
|
entityRef._entity = entity;
|
|
bVar1 = (GHIDRA_CAST<Entity *>((source)))->Entity::IsDamageSourceFriendly(&entityRef);
|
|
if (bVar1 == 0) goto LAB_007074b5;
|
|
}
|
|
else {
|
|
LAB_007074b5:
|
|
if (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) {
|
|
LAB_007074d7:
|
|
if ((source != GHIDRA_CAST<Entity *>(0x0)) &&
|
|
(cVar2 = source->IsValidTarget(entity,uVar3), cVar2 == '\0'))
|
|
goto LAB_0070769b;
|
|
}
|
|
else if (source != GHIDRA_CAST<Entity *>(0x0)) {
|
|
bVar1 = (GHIDRA_CAST<Entity *>((source)))->Entity::IsDescendantOf(entity);
|
|
if (bVar1 != 0) goto LAB_0070769b;
|
|
goto LAB_007074d7;
|
|
}
|
|
if (1 < g_game->_frameCount - entity->_spawnFrame) {
|
|
local_28 = *GHIDRA_CAST<int *>(&g_game->_deathmatchManager);
|
|
if ((local_28 < 2) || (entity->_type != 1)) {
|
|
entityType = entity->_type;
|
|
if (0x3dd < entityType - 10U) goto LAB_0070769b;
|
|
}
|
|
else {
|
|
entityType = 1;
|
|
}
|
|
if (((((entity->_entityCollisionClass != 1) && (entity->_entityCollisionClass != 0)) &&
|
|
(entity->_isInvicible == 0)) && (entity->_dead == 0)) &&
|
|
(((bVar1 = (GHIDRA_CAST<Entity *>((entity)))->Entity::HasEntityFlags(0x10), bVar1 == 0 || (entityType == 0x322)) ||
|
|
(entityType == 0x362)))) {
|
|
if ((local_28 < 2) || (entityType != 1)) {
|
|
if ((entityType - 10U < 0x3de) &&
|
|
(((entityType != 0x21 && (entityType != 0x11)) && (entityType != 0x124)))) {
|
|
if (entityType == 0x375) {
|
|
isSpecialTarget = entity->_variant == 10;
|
|
}
|
|
else {
|
|
if ((entityType == 0x3c0) || (entityType == 0x3c5)) goto LAB_0070769b;
|
|
isSpecialTarget = entityType == 0xf5;
|
|
}
|
|
if (!isSpecialTarget) goto LAB_007075f1;
|
|
}
|
|
}
|
|
else {
|
|
LAB_007075f1:
|
|
uVar5 = GHIDRA_UINT(entity->_flags);
|
|
if (((uVar5 & 0x20000000) == 0) && ((uVar5 & 0x10) == 0)) {
|
|
if (distanceFn == (void *)0x0) {
|
|
dy = pos->y - (entity->_pos).y;
|
|
distSq = pos->x - (entity->_pos).x;
|
|
distSq = dy * dy + distSq * distSq;
|
|
local_28 = *GHIDRA_CAST<int *>((GHIDRA_INT(&entity->_flags) + 4));
|
|
}
|
|
else {
|
|
customDist = (float10)(*distanceFn)(pos,source,entity);
|
|
uVar5 = GHIDRA_UINT(entity->_flags);
|
|
distSq = (float)customDist;
|
|
local_38 = distSq;
|
|
local_28 = *GHIDRA_CAST<int *>((GHIDRA_INT(&entity->_flags) + 4));
|
|
}
|
|
if ((uVar5 & 0x100) != 0) {
|
|
distSq = distSq + 160000.0;
|
|
}
|
|
if (distSq < bestDistSq) {
|
|
bestDistSq = distSq;
|
|
local_14 = entity;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
LAB_0070769b:
|
|
i = i + 1;
|
|
entity = local_14;
|
|
} while (i < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(local_30) + 0x1264)));
|
|
}
|
|
ExceptionList = local_10;
|
|
return entity;
|
|
}
|
|
|
|
// 007076d0
|
|
void Game::FixErasedEnemyID(int *type, int *variant, int *subtype)
|
|
{
|
|
int enemyType;
|
|
|
|
if (0 < *subtype) {
|
|
*subtype = 0;
|
|
}
|
|
enemyType = *type;
|
|
if (enemyType < 0xda) {
|
|
if (enemyType != 0xd9) {
|
|
switch(enemyType) {
|
|
case 10:
|
|
goto switchD_007076fd_caseD_a;
|
|
case 0xb:
|
|
case 0xd0:
|
|
if (*variant == 1) {
|
|
*variant = 0;
|
|
return;
|
|
}
|
|
return;
|
|
default:
|
|
return;
|
|
case 0xce:
|
|
case 0xcf:
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
if (enemyType < 0x32d) {
|
|
if (enemyType == 0x32c) {
|
|
*type = 0xc;
|
|
return;
|
|
}
|
|
if ((enemyType != 0x129) && (enemyType != 299)) {
|
|
return;
|
|
}
|
|
switchD_007076fd_caseD_a:
|
|
*type = 10;
|
|
if (*variant < 1) {
|
|
return;
|
|
}
|
|
*variant = 0;
|
|
return;
|
|
}
|
|
if (enemyType == 0x32e) {
|
|
*type = 0x55;
|
|
return;
|
|
}
|
|
if (enemyType != 0x338) {
|
|
return;
|
|
}
|
|
}
|
|
if (*variant < 1) {
|
|
return;
|
|
}
|
|
*variant = 0;
|
|
return;
|
|
}
|
|
|
|
// 00707840
|
|
void Game::AddErasedEnemy(Entity *entity)
|
|
{
|
|
std_vector *this;
|
|
int *erasedEntry;
|
|
int type;
|
|
int variant;
|
|
void *erasedEnd;
|
|
Entity *fixedSubType;
|
|
int fixedType;
|
|
int fixedVariant;
|
|
Game *game;
|
|
|
|
game = g_game;
|
|
variant = entity->_variant;
|
|
type = entity->_type;
|
|
if (type != 0x3b6) {
|
|
entity = GHIDRA_CAST<Entity *>(entity->_subtype);
|
|
FixErasedEnemyID(&type,&variant,GHIDRA_CAST<int *>(&entity));
|
|
fixedVariant = variant;
|
|
fixedType = type;
|
|
fixedSubType = entity;
|
|
this = &game->_erasedEntities;
|
|
for (erasedEntry = this->_begin; erasedEntry != (game->_erasedEntities)._end;
|
|
erasedEntry = erasedEntry + 3) {
|
|
if (((*erasedEntry == type) && (erasedEntry[1] == variant)) &&
|
|
(GHIDRA_CAST<Entity *>(erasedEntry[2]) == entity)) {
|
|
return;
|
|
}
|
|
}
|
|
vector12_resize(this,(GHIDRA_INT((game->_erasedEntities)._end) - GHIDRA_INT(this->_begin)) / 0xc + 1);
|
|
erasedEnd = (game->_erasedEntities)._end;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(erasedEnd) + -0xc)) = fixedType;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(erasedEnd) + -8)) = fixedVariant;
|
|
*GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(erasedEnd) + -4)) = fixedSubType;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007078f0
|
|
byte Game::ShouldEraseEnemy(Entity *entity)
|
|
{
|
|
int *erasedEntry;
|
|
int subType;
|
|
int variant;
|
|
int type [2];
|
|
Game *game;
|
|
|
|
game = g_game;
|
|
type[0] = entity->_type;
|
|
if ((type[0] != 0x3b6) &&
|
|
((((*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2 || (type[0] != 1)) && (0x3dd < type[0] - 10U)) ||
|
|
((entity->_flags & 0x20000000) == 0)))) {
|
|
subType = entity->_subtype;
|
|
erasedEntry = (g_game->_erasedEntities)._begin;
|
|
variant = entity->_variant;
|
|
if (erasedEntry != (g_game->_erasedEntities)._end) {
|
|
FixErasedEnemyID(type,&variant,&subType);
|
|
for (; erasedEntry != (game->_erasedEntities)._end; erasedEntry = erasedEntry + 3) {
|
|
if (((*erasedEntry == type[0]) && ((erasedEntry[1] < 0 || (erasedEntry[1] == variant)))) &&
|
|
((erasedEntry[2] < 0 || (erasedEntry[2] == subType)))) {
|
|
return 1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 00708050
|
|
void Game::SaveBackwardsStage(int stage)
|
|
{
|
|
RoomDescriptor *dest;
|
|
void *roomConfig;
|
|
Game *this;
|
|
int iVar1;
|
|
RoomDescriptor *source;
|
|
int roomIdx;
|
|
uint bossRoomCount;
|
|
Game *game;
|
|
|
|
game = g_game;
|
|
if ((stage < 1) || (7 < stage)) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Invalid backwards path stage ID"));
|
|
}
|
|
this = g_game;
|
|
dest = GHIDRA_CAST<RoomDescriptor *>((game->_glowingHourglassStates[1]._eventCounters + stage * 200 + 0x17b));
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>((game->_glowingHourglassStates + 2)) + (stage * 200 + 0x35) * 4)) = 0;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>((game->_glowingHourglassStates + 2)) + (stage * 200 + 0x36) * 4)) = this->_stageType;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>((game->_glowingHourglassStates + 2)) + (stage * 200 + 0x34) * 4)) = 1;
|
|
GameState::copy_room_list(dest,this->_roomList + this->_lastBossRoomListIdx);
|
|
roomConfig = (void *)game->_glowingHourglassStates[1]._eventCounters[stage * 200 + 0x17f];
|
|
if (roomConfig != (void *)0x0) {
|
|
Level::write_room_config
|
|
(GHIDRA_CAST<Level *>(this),roomConfig,
|
|
game->_glowingHourglassStates[1]._eventCounters + stage * 200 + 0x1d7,(void *)0x0);
|
|
}
|
|
game->_glowingHourglassStates[1]._eventCounters[stage * 200 + 0x17f] = 0;
|
|
roomIdx = 0;
|
|
if (0 < this->_nbRooms) {
|
|
source = this->_roomList;
|
|
do {
|
|
if ((source->Data != (void *)0x0) && (source->Dimension == 0)) {
|
|
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(source->Data) + 8));
|
|
if (iVar1 == 5) {
|
|
if ((roomIdx != this->_lastBossRoomListIdx) &&
|
|
(GHIDRA_UINT(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>((game->_glowingHourglassStates + 2)) + (stage * 200 + 0x34) * 4))) <
|
|
2)) {
|
|
GameState::copy_room_list
|
|
(dest + *GHIDRA_CAST<int *>((GHIDRA_INT((game->_glowingHourglassStates + 2)) +
|
|
(stage * 200 + 0x34) * 4)),source);
|
|
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>((game->_glowingHourglassStates + 2)) + (stage * 200 + 0x34) * 4));
|
|
if (dest[iVar1].Data != (void *)0x0) {
|
|
Level::write_room_config
|
|
(GHIDRA_CAST<Level *>(this),dest[iVar1].Data,dest[2]._doors + iVar1 * 3 + -7,(void *)0x0)
|
|
;
|
|
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>((game->_glowingHourglassStates + 2)) + (stage * 200 + 0x34) * 4));
|
|
}
|
|
dest[iVar1].Data = (void *)0x0;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>((game->_glowingHourglassStates + 2)) + (stage * 200 + 0x34) * 4)) =
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>((game->_glowingHourglassStates + 2)) + (stage * 200 + 0x34) * 4)) + 1;
|
|
}
|
|
}
|
|
else if ((iVar1 == 4) &&
|
|
(GHIDRA_UINT(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>((game->_glowingHourglassStates + 2)) + (stage * 200 + 0x35) * 4)))
|
|
< 2)) {
|
|
GameState::copy_room_list
|
|
((RoomDescriptor *)
|
|
(game->_glowingHourglassStates[1]._eventCounters +
|
|
stage * 200 +
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>((game->_glowingHourglassStates + 2)) + (stage * 200 + 0x35) * 4)) *
|
|
0x2e + 0x1dd),source);
|
|
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>((game->_glowingHourglassStates + 2)) + (stage * 200 + 0x35) * 4));
|
|
if ((void *)dest[iVar1 + 2]._doors[3] != (void *)0x0) {
|
|
Level::write_room_config
|
|
(GHIDRA_CAST<Level *>(this),(void *)dest[iVar1 + 2]._doors[3],
|
|
dest[4]._doors + iVar1 * 3 + -1,(void *)0x0);
|
|
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>((game->_glowingHourglassStates + 2)) + (stage * 200 + 0x35) * 4));
|
|
}
|
|
dest[iVar1 + 2]._doors[3] = 0;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>((game->_glowingHourglassStates + 2)) + (stage * 200 + 0x35) * 4)) =
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>((game->_glowingHourglassStates + 2)) + (stage * 200 + 0x35) * 4)) + 1;
|
|
}
|
|
}
|
|
roomIdx = roomIdx + 1;
|
|
source = source + 1;
|
|
} while (roomIdx < this->_nbRooms);
|
|
}
|
|
bossRoomCount = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>((game->_glowingHourglassStates + 2)) + (stage * 200 + 0x34) * 4));
|
|
*GHIDRA_CAST<bool *>((GHIDRA_CAST<char *>((game->_glowingHourglassStates + 2)) + (stage * 200 + 0x37) * 4)) = 1 < bossRoomCount
|
|
;
|
|
if ((1 < bossRoomCount) && (stage < 7)) {
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>((game->_glowingHourglassStates + 2)) + (stage * 200 + 0xfc) * 4)) = 0;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>((game->_glowingHourglassStates + 2)) + (stage * 200 + 0xfd) * 4)) = 0;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007084c0
|
|
void Game::recreate_render_targets()
|
|
{
|
|
undefined4 extraout_ECX;
|
|
undefined4 extraout_ECX_00;
|
|
undefined4 extraout_ECX_01;
|
|
undefined4 extraout_ECX_02;
|
|
undefined4 extraout_ECX_03;
|
|
undefined4 extraout_ECX_04;
|
|
undefined4 extraout_ECX_05;
|
|
undefined4 extraout_ECX_06;
|
|
undefined4 extraout_ECX_07;
|
|
undefined4 extraout_ECX_08;
|
|
undefined4 extraout_ECX_09;
|
|
undefined4 extraout_ECX_10;
|
|
undefined4 extraout_ECX_11;
|
|
undefined4 extraout_ECX_12;
|
|
undefined4 extraout_ECX_13;
|
|
undefined4 extraout_ECX_14;
|
|
undefined4 extraout_ECX_15;
|
|
undefined4 extraout_ECX_16;
|
|
float screenMarginY;
|
|
float screenMarginX;
|
|
Manager *manager;
|
|
void *room;
|
|
|
|
FUN_0082ed00();
|
|
room = this->_room;
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_00);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_01);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_02);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_03);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_04);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_05);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_06);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_07);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_08);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_09);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_10);
|
|
init_room_render_surfaces();
|
|
screenMarginX = g_screenWidth - 338.0;
|
|
screenMarginY = g_screenHeight - 182.0;
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(room) + 0x11f6)) = 1;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(room) + 0x11fc)) = screenMarginX * 0.5 - 52.0;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(room) + 0x1200)) = screenMarginY * 0.5 - 52.0;
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_11);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_12);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_13);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_14);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_15);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_16);
|
|
create_render_surfaces();
|
|
FUN_00692960();
|
|
manager = g_manager;
|
|
FUN_008f7dd0();
|
|
(GHIDRA_CAST<ModManager *>((&manager->_modManager)))->ModManager::create_shader_render_targets();
|
|
return;
|
|
}
|
|
|
|
// 00708630
|
|
void Game::update_trapdoor_loop_sfx()
|
|
{
|
|
Game *trapdoor = this;
|
|
void *pvVar1;
|
|
byte isPlaying;
|
|
uint gridIndex;
|
|
RoomDescriptor *neighborRoom;
|
|
Vector *pVVar2;
|
|
Entity_Player *player;
|
|
float *pfVar3;
|
|
undefined4 *gridSlot;
|
|
int iVar4;
|
|
float fVar5;
|
|
float local_24;
|
|
Vector local_20;
|
|
float distanceVolume;
|
|
undefined1 local_14 [16];
|
|
int door;
|
|
bool isTrapdoorRoom;
|
|
Manager *manager;
|
|
int *roomConfig;
|
|
SoundEffects *sfxManager;
|
|
GridEntity *trapdoor;
|
|
|
|
local_20.x = 0.0;
|
|
pvVar1 = trapdoor->_room;
|
|
local_24 = 0.0;
|
|
isTrapdoorRoom = false;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0.0;
|
|
distanceVolume = 1.0;
|
|
if ((((pvVar1 != (void *)0x0) && (trapdoor->_difficulty != 2)) && (trapdoor->_difficulty != 3)) &&
|
|
((trapdoor->_stage != 9 && (trapdoor->_stage != 0xd)))) {
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 8)) == 5) &&
|
|
((roomConfig = *GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 4)) + 0x10)), *roomConfig == 0 &&
|
|
(roomConfig[4] == 0x58)))) {
|
|
iVar4 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x10)) * *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0xc));
|
|
gridIndex = 0;
|
|
isTrapdoorRoom = true;
|
|
if (0 < iVar4) {
|
|
gridSlot = GHIDRA_CAST<undefined4 *>((GHIDRA_INT(pvVar1) + 0x24));
|
|
do {
|
|
if (((gridIndex < 0x1c0) &&
|
|
(trapdoor = GHIDRA_CAST<GridEntity *>(*gridSlot), trapdoor != GHIDRA_CAST<GridEntity *>(0x0))) &&
|
|
((trapdoor->_desc)._type == 0x11)) {
|
|
pVVar2 = (GHIDRA_CAST<GridEntity *>((trapdoor)))->GridEntity::Position(GHIDRA_CAST<Vector *>((local_14 + 4)));
|
|
local_24 = pVVar2->x;
|
|
local_20.x = pVVar2->y;
|
|
break;
|
|
}
|
|
gridIndex = gridIndex + 1;
|
|
gridSlot = gridSlot + 1;
|
|
} while (GHIDRA_INT(gridIndex) < iVar4);
|
|
}
|
|
}
|
|
iVar4 = 0;
|
|
do {
|
|
if (isTrapdoorRoom) {
|
|
LAB_00708805:
|
|
player = (GHIDRA_CAST<PlayerManager *>((&trapdoor->_playerManager)))->PlayerManager::get_first_local_main_player();
|
|
if (player != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
local_24 = local_24 - (player->_pos).x;
|
|
fVar5 = local_20.x - (player->_pos).y;
|
|
fVar5 = sqrtf(local_24 * local_24 + fVar5 * fVar5);
|
|
if (0.0 < fVar5) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0.6;
|
|
distanceVolume = 200.0 / fVar5;
|
|
pfVar3 = GHIDRA_CAST<float *>(local_14);
|
|
if (0.6 <= 200.0 / fVar5) {
|
|
pfVar3 = &distanceVolume;
|
|
}
|
|
distanceVolume = *pfVar3;
|
|
if (1.0 <= distanceVolume) {
|
|
distanceVolume = 1.0;
|
|
}
|
|
}
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0.75;
|
|
local_20.x = local_24 / 300.0;
|
|
pVVar2 = GHIDRA_CAST<Vector *>(local_14);
|
|
if (local_24 / 300.0 <= 0.75) {
|
|
pVVar2 = &local_20;
|
|
}
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = pVVar2->x;
|
|
if ((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)local_14)) + 0x0))) <= -0.75) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = -0.75;
|
|
}
|
|
}
|
|
isPlaying = (GHIDRA_CAST<SFXManager *>((&g_manager->_sfxManager)))->SFXManager::IsPlaying(0x3f0);
|
|
manager = g_manager;
|
|
fVar5 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((trapdoor)) + 0x68d74))));
|
|
if (isPlaying == 0) {
|
|
local_20.x = 1.41251e-42;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_20));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_20.x),fVar5,0,1,1.0,0.0);
|
|
return;
|
|
}
|
|
fVar5 = fVar5 + 0.05;
|
|
if (1.0 <= fVar5) {
|
|
fVar5 = 1.0;
|
|
}
|
|
sfxManager = &g_manager->_sfxManager;
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((trapdoor)) + 0x68d74)))) = fVar5;
|
|
(GHIDRA_CAST<SFXManager *>((sfxManager)))->SFXManager::AdjustVolume(0x3f0,fVar5 * distanceVolume);
|
|
(GHIDRA_CAST<SFXManager *>((&g_manager->_sfxManager)))->SFXManager::adjust_pan(0x3f0,(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)local_14)) + 0x0))));
|
|
return;
|
|
}
|
|
door = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + iVar4 * 4 + 0x724));
|
|
if ((door != 0) && (*GHIDRA_CAST<int *>((door + 0x160)) == 5)) {
|
|
neighborRoom = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(trapdoor))))->Level::GetRoomByIdx(*GHIDRA_CAST<int *>((door + 0x394)),-1);
|
|
roomConfig = neighborRoom->Data;
|
|
if ((((roomConfig == GHIDRA_CAST<int *>(0x0)) || (*roomConfig != 0)) ||
|
|
((roomConfig[4] != 0x58 && (roomConfig[4] != 0x37)))) &&
|
|
(((neighborRoom->Flags & 1) == 0 &&
|
|
(((*GHIDRA_CAST<byte *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 4)) + 0x44)) & 1) != 0 ||
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x1bb0)) == 0)))))) {
|
|
pVVar2 = (GHIDRA_CAST<GridEntity *>((*GHIDRA_CAST<GridEntity **>((GHIDRA_CAST<char *>(pvVar1) + iVar4 * 4 + 0x724)))))->GridEntity::Position(&local_20)
|
|
;
|
|
local_24 = pVVar2->x;
|
|
local_20.x = pVVar2->y;
|
|
goto LAB_00708805;
|
|
}
|
|
}
|
|
iVar4 = iVar4 + 1;
|
|
} while (iVar4 < 8);
|
|
}
|
|
isPlaying = (GHIDRA_CAST<SFXManager *>((&g_manager->_sfxManager)))->SFXManager::IsPlaying(0x3f0);
|
|
if (isPlaying != 0) {
|
|
if (0.05 <= *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((trapdoor)) + 0x68d74))))) {
|
|
fVar5 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((trapdoor)) + 0x68d74)))) - 0.05;
|
|
sfxManager = &g_manager->_sfxManager;
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((trapdoor)) + 0x68d74)))) = fVar5;
|
|
(GHIDRA_CAST<SFXManager *>((sfxManager)))->SFXManager::AdjustVolume(0x3f0,fVar5);
|
|
return;
|
|
}
|
|
(GHIDRA_CAST<SFXManager *>((&g_manager->_sfxManager)))->SFXManager::Stop(0x3f0);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00738310
|
|
void Game::ClearDonationModGreed()
|
|
{
|
|
this->_donationModGreed = 0;
|
|
return;
|
|
}
|
|
|
|
// 00738320
|
|
void Game::ClearDonationModAngel()
|
|
{
|
|
this->_donationModAngel = 0;
|
|
return;
|
|
}
|
|
|
|
// 00738340
|
|
void * Game::get_backwards_stage(int stage)
|
|
{
|
|
Game *game;
|
|
|
|
game = g_game;
|
|
if ((stage < 1) || (7 < stage)) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Invalid backwards path stage ID"));
|
|
}
|
|
return game->_glowingHourglassStates[1]._eventCounters + stage * 200 + 0x17b;
|
|
}
|
|
|
|
// 007383a0
|
|
int Game::GetTreasureRoomVisitCount()
|
|
{
|
|
return this->_treasureRoomsVisited;
|
|
}
|
|
|
|
// 00738470
|
|
uint Game::GetStageID(byte unused)
|
|
{
|
|
uint uVar1;
|
|
|
|
if (g_game->_challenge == 0x2c) {
|
|
uVar1 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(this))))->Level::GetRoomStageType(this->_currentRoomIdx);
|
|
uVar1 = RoomConfig::GetStageID(this->_stage,uVar1,-1);
|
|
return uVar1;
|
|
}
|
|
if (this->_currentDimensionIdx == 2) {
|
|
return 0x23;
|
|
}
|
|
uVar1 = RoomConfig::GetStageID(this->_stage,this->_stageType,-1);
|
|
return uVar1;
|
|
}
|
|
|
|
// 0073f940
|
|
void Game::UpdateVisibility()
|
|
{
|
|
int iVar1;
|
|
byte isHasMirrorDimension;
|
|
RoomDescriptor *fromRoom;
|
|
RoomDescriptor *targetRoom;
|
|
int doorSlot;
|
|
Game *game;
|
|
void *room;
|
|
|
|
room = this->_room;
|
|
fromRoom = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(this))))->Level::GetRoomByIdx(this->_currentRoomIdx,-1);
|
|
fromRoom->DisplayFlags = fromRoom->DisplayFlags | 5;
|
|
if (-1 < this->_currentRoomIdx) {
|
|
isHasMirrorDimension = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(this))))->Level::HasMirrorDimension();
|
|
if (isHasMirrorDimension != 0) {
|
|
targetRoom = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(this))))->Level::GetRoomByIdx(this->_currentRoomIdx,
|
|
1 - this->_currentDimensionIdx);
|
|
targetRoom->DisplayFlags = targetRoom->DisplayFlags | 5;
|
|
}
|
|
}
|
|
doorSlot = 0;
|
|
do {
|
|
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + doorSlot * 4 + 0x724));
|
|
if ((iVar1 != 0) && (iVar1 = *GHIDRA_CAST<int *>((iVar1 + 0x394)), -1 < iVar1)) {
|
|
targetRoom = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(this))))->Level::GetRoomByIdx(iVar1,-1);
|
|
Level::reveal_room_visibility(GHIDRA_CAST<Level *>(this),targetRoom,fromRoom,doorSlot);
|
|
}
|
|
game = g_game;
|
|
doorSlot = doorSlot + 1;
|
|
} while (doorSlot < 8);
|
|
(GHIDRA_CAST<Minimap *>((GHIDRA_CAST<Minimap *>((g_game->_minimap)._config))))->Minimap::refresh_room_icons();
|
|
Minimap::refresh_room_icons
|
|
(GHIDRA_CAST<Minimap *>(((game->_minimap)._config[1]._mapSprite._filename._buf + 4)));
|
|
game = g_game;
|
|
if ((g_game->_hud)._hudRefreshType != 2) {
|
|
(g_game->_hud)._hudRefreshType = 1;
|
|
(game->_hud)._hudRefreshCountdown = 2;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00740db0
|
|
RoomDescriptor * Game::GetCurrentRoomDesc()
|
|
{
|
|
RoomDescriptor *roomDesc;
|
|
|
|
roomDesc = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(this))))->Level::GetRoomByIdx(this->_currentRoomIdx,this->_currentDimensionIdx);
|
|
return roomDesc;
|
|
}
|
|
|
|
// 0074dbd0
|
|
float Game::GetPlanetariumChance()
|
|
{
|
|
bool bVar1;
|
|
byte isHeld;
|
|
Entity_Player *owner;
|
|
ChallengeParam *challengeParams;
|
|
char isGoldenLens;
|
|
Game *game;
|
|
undefined1 local_20 [8];
|
|
void *roomsetNode;
|
|
int effectiveStage;
|
|
undefined4 treasureRoomType;
|
|
float chance;
|
|
char isMomsBox;
|
|
bool isTelescopeLens;
|
|
int stage;
|
|
|
|
chance = 0.01;
|
|
stage = this->_stage;
|
|
if ((this->_stageType == 4) || (this->_stageType == 5)) {
|
|
bVar1 = true;
|
|
}
|
|
else {
|
|
bVar1 = false;
|
|
}
|
|
effectiveStage = stage + 1;
|
|
if (!bVar1) {
|
|
effectiveStage = stage;
|
|
}
|
|
owner = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::FirstTrinketOwner(0x98);
|
|
if (owner == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
LAB_0074dc38:
|
|
bVar1 = false;
|
|
isTelescopeLens = false;
|
|
if (owner != GHIDRA_CAST<Entity_Player *>(0x0)) goto LAB_0074dc3e;
|
|
LAB_0074dc52:
|
|
isGoldenLens = '\0';
|
|
if (owner != GHIDRA_CAST<Entity_Player *>(0x0)) goto LAB_0074dc58;
|
|
LAB_0074dc6e:
|
|
isMomsBox = '\0';
|
|
}
|
|
else {
|
|
isHeld = (GHIDRA_CAST<Entity_Player *>((owner)))->Entity_Player::HasTrinket(0x98,0);
|
|
if (isHeld == 0) goto LAB_0074dc38;
|
|
isTelescopeLens = true;
|
|
LAB_0074dc3e:
|
|
bVar1 = isTelescopeLens;
|
|
isHeld = (GHIDRA_CAST<Entity_Player *>((owner)))->Entity_Player::HasGoldenTrinket(0x98);
|
|
if (isHeld == 0) goto LAB_0074dc52;
|
|
isGoldenLens = '\x01';
|
|
LAB_0074dc58:
|
|
isHeld = (GHIDRA_CAST<Entity_Player *>((owner)))->Entity_Player::HasCollectible(0x1b7,0);
|
|
if (isHeld == 0) goto LAB_0074dc6e;
|
|
isMomsBox = '\x01';
|
|
}
|
|
game = g_game;
|
|
if (((10 < stage) || ((6 < stage && (!bVar1)))) ||
|
|
((8 < stage && ((isGoldenLens == '\0' && (isMomsBox == '\0')))))) {
|
|
return 0.0;
|
|
}
|
|
if (g_game->_planetariumsVisited == 0) {
|
|
challengeParams = GetChallengeParams(g_game);
|
|
treasureRoomType = 4;
|
|
std::set<int>::find_node(local_20,&treasureRoomType);
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(roomsetNode) + 0xd)) != '\0') || (4 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(roomsetNode) + 0x10)))) ||
|
|
(roomsetNode == (challengeParams->_roomset)._head)) {
|
|
if (game->_treasureRoomsVisited < effectiveStage + -1) {
|
|
chance = (float)((effectiveStage - game->_treasureRoomsVisited) + -1) * 0.2 + 0.01;
|
|
owner = PlayerManager::FirstCollectibleOwner
|
|
(&game->_playerManager,0x9e,GHIDRA_CAST<RNG **>(&game->_playerManager),1);
|
|
game = g_game;
|
|
if (owner != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
chance = chance + 1.0;
|
|
}
|
|
}
|
|
}
|
|
owner = PlayerManager::FirstCollectibleOwner
|
|
(&game->_playerManager,0xc2,GHIDRA_CAST<RNG **>(&game->_playerManager),1);
|
|
if (owner != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
chance = chance + 0.15;
|
|
}
|
|
owner = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x9e,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
|
|
if (owner != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
chance = chance + 0.15;
|
|
}
|
|
owner = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x29d,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
|
|
if (owner != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
chance = chance + 0.069;
|
|
}
|
|
if (!bVar1) goto LAB_0074ddfd;
|
|
chance = chance + 0.15;
|
|
}
|
|
else if (!bVar1) goto LAB_0074ddfd;
|
|
if (isGoldenLens == isMomsBox) {
|
|
if (isGoldenLens == '\0') {
|
|
chance = chance + 0.09;
|
|
}
|
|
else {
|
|
chance = chance + 0.33;
|
|
}
|
|
}
|
|
else {
|
|
chance = chance + 0.18;
|
|
}
|
|
LAB_0074ddfd:
|
|
if (chance <= 0.01) {
|
|
chance = 0.01;
|
|
}
|
|
if (1.0 <= chance) {
|
|
chance = 1.0;
|
|
}
|
|
return chance;
|
|
}
|
|
|
|
// 0074de30
|
|
void Game::generate_home_level()
|
|
{
|
|
RNG *rng;
|
|
void *unused;
|
|
code *pcVar1;
|
|
uint seed;
|
|
void *pvVar2;
|
|
void *bossSlotA;
|
|
void *treasureSlot;
|
|
void *bossSlotB;
|
|
void *defaultSlot;
|
|
RoomConfig_Room *pRVar3;
|
|
RoomConfig_Room *bossRoomA;
|
|
RoomConfig_Room *treasureRoom;
|
|
RoomConfig_Room *bossRoomB;
|
|
RoomConfig_Room *defaultRoom;
|
|
int iVar4;
|
|
RoomDescriptor *specialRoomDesc;
|
|
RoomConfig *roomConfig;
|
|
int *roomMapCell;
|
|
void *local_3b4;
|
|
RoomConfig_Room *local_3b0;
|
|
RoomDescriptor generator [4];
|
|
int local_48 [2];
|
|
int local_40;
|
|
undefined1 local_3c [12];
|
|
undefined1 local_30 [28];
|
|
uint local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00afe350;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_UINT((local_30 + 0x2c));
|
|
ExceptionList = &local_10;
|
|
seed = (this->_generationRNG)._seed;
|
|
rng = &this->_generationRNG;
|
|
if (seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
seed = rng->_seed;
|
|
if (seed == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
seed = seed >> ((byte)(this->_generationRNG)._shift1 & 0x1f) ^ seed;
|
|
seed = seed << ((byte)(this->_generationRNG)._shift2 & 0x1f) ^ seed;
|
|
seed = seed >> ((byte)(this->_generationRNG)._shift3 & 0x1f) ^ seed;
|
|
rng->_seed = seed;
|
|
(GHIDRA_CAST<RoomDescriptor *>((generator)))->RoomDescriptor::Init(seed);
|
|
local_8 = 0;
|
|
if (GHIDRA_UINT(((local_40 - local_48[0]) / 0x48)) < 6) {
|
|
vector_LevelGenerator_Room_reserve(local_48,6);
|
|
}
|
|
pvVar2 = LevelGenerator::CreateRoom(GHIDRA_CAST<LevelGenerator *>(generator),6,6,1,-1,-1,-1);
|
|
bossSlotA = LevelGenerator::CreateRoom(GHIDRA_CAST<LevelGenerator *>(generator),6,7,4,6,7,3);
|
|
treasureSlot = LevelGenerator::CreateRoom(GHIDRA_CAST<LevelGenerator *>(generator),5,8,4,5,8,0);
|
|
bossSlotB = LevelGenerator::CreateRoom(GHIDRA_CAST<LevelGenerator *>(generator),4,7,4,4,8,0);
|
|
defaultSlot = LevelGenerator::CreateRoom(GHIDRA_CAST<LevelGenerator *>(generator),4,6,1,4,6,1);
|
|
local_3b4 = LevelGenerator::CreateRoom(GHIDRA_CAST<LevelGenerator *>(generator),7,7,2,7,7,2);
|
|
seed = rng->_seed;
|
|
roomConfig = &g_game->_roomConfig;
|
|
local_3b0 = GHIDRA_CAST<RoomConfig_Room *>(0x0);
|
|
if (seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
seed = rng->_seed;
|
|
if (seed == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
seed = seed >> ((byte)(this->_generationRNG)._shift1 & 0x1f) ^ seed;
|
|
seed = seed << ((byte)(this->_generationRNG)._shift2 & 0x1f) ^ seed;
|
|
seed = seed >> ((byte)(this->_generationRNG)._shift3 & 0x1f) ^ seed;
|
|
rng->_seed = seed;
|
|
pRVar3 = RoomConfig::GetRandomRoom(roomConfig,seed,1,0x23,1,1,0,-1,1,10,GHIDRA_CAST<uint *>(&local_3b0),0,-1);
|
|
seed = rng->_seed;
|
|
local_3b0 = GHIDRA_CAST<RoomConfig_Room *>(0x0);
|
|
if (seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
seed = rng->_seed;
|
|
if (seed == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
seed = seed >> ((byte)(this->_generationRNG)._shift1 & 0x1f) ^ seed;
|
|
seed = seed << ((byte)(this->_generationRNG)._shift2 & 0x1f) ^ seed;
|
|
seed = seed >> ((byte)(this->_generationRNG)._shift3 & 0x1f) ^ seed;
|
|
rng->_seed = seed;
|
|
bossRoomA = RoomConfig::GetRandomRoom
|
|
(roomConfig,seed,1,0x23,1,5,0,-1,1,10,GHIDRA_CAST<uint *>(&local_3b0),1,-1);
|
|
seed = rng->_seed;
|
|
local_3b0 = GHIDRA_CAST<RoomConfig_Room *>(0x0);
|
|
if (seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
seed = rng->_seed;
|
|
if (seed == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
seed = seed >> ((byte)(this->_generationRNG)._shift1 & 0x1f) ^ seed;
|
|
seed = seed << ((byte)(this->_generationRNG)._shift2 & 0x1f) ^ seed;
|
|
seed = seed >> ((byte)(this->_generationRNG)._shift3 & 0x1f) ^ seed;
|
|
rng->_seed = seed;
|
|
treasureRoom = RoomConfig::GetRandomRoom
|
|
(roomConfig,seed,1,0x23,1,4,0,-1,1,10,GHIDRA_CAST<uint *>(&local_3b0),3,-1);
|
|
seed = rng->_seed;
|
|
local_3b0 = GHIDRA_CAST<RoomConfig_Room *>(0x0);
|
|
if (seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
seed = rng->_seed;
|
|
if (seed == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
seed = seed >> ((byte)(this->_generationRNG)._shift1 & 0x1f) ^ seed;
|
|
seed = seed << ((byte)(this->_generationRNG)._shift2 & 0x1f) ^ seed;
|
|
seed = seed >> ((byte)(this->_generationRNG)._shift3 & 0x1f) ^ seed;
|
|
rng->_seed = seed;
|
|
bossRoomB = RoomConfig::GetRandomRoom
|
|
(roomConfig,seed,1,0x23,1,5,0,-1,1,10,GHIDRA_CAST<uint *>(&local_3b0),1,-1);
|
|
seed = rng->_seed;
|
|
local_3b0 = GHIDRA_CAST<RoomConfig_Room *>(0x0);
|
|
if (seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
seed = rng->_seed;
|
|
if (seed == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
seed = seed >> ((byte)(this->_generationRNG)._shift1 & 0x1f) ^ seed;
|
|
seed = seed << ((byte)(this->_generationRNG)._shift2 & 0x1f) ^ seed;
|
|
seed = seed >> ((byte)(this->_generationRNG)._shift3 & 0x1f) ^ seed;
|
|
rng->_seed = seed;
|
|
defaultRoom = RoomConfig::GetRandomRoom
|
|
(roomConfig,seed,1,0x23,1,1,0,-1,1,10,GHIDRA_CAST<uint *>(&local_3b0),2,-1);
|
|
seed = rng->_seed;
|
|
local_3b0 = GHIDRA_CAST<RoomConfig_Room *>(0x0);
|
|
if (seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
seed = rng->_seed;
|
|
if (seed == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
seed = seed >> ((byte)(this->_generationRNG)._shift1 & 0x1f) ^ seed;
|
|
seed = seed << ((byte)(this->_generationRNG)._shift2 & 0x1f) ^ seed;
|
|
seed = seed >> ((byte)(this->_generationRNG)._shift3 & 0x1f) ^ seed;
|
|
rng->_seed = seed;
|
|
local_3b0 = RoomConfig::GetRandomRoom
|
|
(roomConfig,seed,1,0x23,1,2,0,-1,1,10,GHIDRA_CAST<uint *>(&local_3b0),10,-1);
|
|
roomMapCell = this->_roomMap;
|
|
for (iVar4 = 0x1fb; iVar4 != 0; iVar4 = iVar4 + -1) {
|
|
*roomMapCell = -1;
|
|
roomMapCell = roomMapCell + 1;
|
|
}
|
|
this->_nbRooms = 0;
|
|
seed = rng->_seed;
|
|
if (seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
seed = rng->_seed;
|
|
if (seed == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
seed = seed >> ((byte)(this->_generationRNG)._shift1 & 0x1f) ^ seed;
|
|
unused = (void *)(this->_generationRNG)._shift3;
|
|
seed = seed << ((byte)(this->_generationRNG)._shift2 & 0x1f) ^ seed;
|
|
seed = seed >> ((byte)unused & 0x1f) ^ seed;
|
|
rng->_seed = seed;
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(this))))->Level::place_room(pvVar2,pRVar3,seed,unused,GHIDRA_CAST<RoomDescriptor **>(0x0));
|
|
seed = rng->_seed;
|
|
if (seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
seed = rng->_seed;
|
|
if (seed == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
seed = seed >> ((byte)(this->_generationRNG)._shift1 & 0x1f) ^ seed;
|
|
pvVar2 = (void *)(this->_generationRNG)._shift3;
|
|
seed = seed << ((byte)(this->_generationRNG)._shift2 & 0x1f) ^ seed;
|
|
seed = seed >> ((byte)pvVar2 & 0x1f) ^ seed;
|
|
rng->_seed = seed;
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(this))))->Level::place_room(bossSlotA,bossRoomA,seed,pvVar2,GHIDRA_CAST<RoomDescriptor **>(0x0));
|
|
seed = rng->_seed;
|
|
if (seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
seed = rng->_seed;
|
|
if (seed == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
seed = seed >> ((byte)(this->_generationRNG)._shift1 & 0x1f) ^ seed;
|
|
pvVar2 = (void *)(this->_generationRNG)._shift3;
|
|
seed = seed << ((byte)(this->_generationRNG)._shift2 & 0x1f) ^ seed;
|
|
seed = seed >> ((byte)pvVar2 & 0x1f) ^ seed;
|
|
rng->_seed = seed;
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(this))))->Level::place_room(treasureSlot,treasureRoom,seed,pvVar2,GHIDRA_CAST<RoomDescriptor **>(0x0));
|
|
this->_lastBossRoomListIdx = this->_nbRooms + -1;
|
|
seed = rng->_seed;
|
|
if (seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
seed = rng->_seed;
|
|
if (seed == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
seed = seed >> ((byte)(this->_generationRNG)._shift1 & 0x1f) ^ seed;
|
|
pvVar2 = (void *)(this->_generationRNG)._shift3;
|
|
seed = seed << ((byte)(this->_generationRNG)._shift2 & 0x1f) ^ seed;
|
|
seed = seed >> ((byte)pvVar2 & 0x1f) ^ seed;
|
|
rng->_seed = seed;
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(this))))->Level::place_room(bossSlotB,bossRoomB,seed,pvVar2,GHIDRA_CAST<RoomDescriptor **>(0x0));
|
|
seed = rng->_seed;
|
|
if (seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
seed = rng->_seed;
|
|
if (seed == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
seed = seed >> ((byte)(this->_generationRNG)._shift1 & 0x1f) ^ seed;
|
|
pvVar2 = (void *)(this->_generationRNG)._shift3;
|
|
seed = seed << ((byte)(this->_generationRNG)._shift2 & 0x1f) ^ seed;
|
|
seed = seed >> ((byte)pvVar2 & 0x1f) ^ seed;
|
|
rng->_seed = seed;
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(this))))->Level::place_room(defaultSlot,defaultRoom,seed,pvVar2,GHIDRA_CAST<RoomDescriptor **>(0x0));
|
|
seed = rng->_seed;
|
|
if (seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
seed = rng->_seed;
|
|
if (seed == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
seed = seed >> ((byte)(this->_generationRNG)._shift1 & 0x1f) ^ seed;
|
|
pvVar2 = (void *)(this->_generationRNG)._shift3;
|
|
seed = seed << ((byte)(this->_generationRNG)._shift2 & 0x1f) ^ seed;
|
|
seed = seed >> ((byte)pvVar2 & 0x1f) ^ seed;
|
|
rng->_seed = seed;
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(this))))->Level::place_room(local_3b4,local_3b0,seed,pvVar2,GHIDRA_CAST<RoomDescriptor **>(0x0));
|
|
pvVar2 = ThreadLocalStoragePointer;
|
|
if ((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(ThreadLocalStoragePointer) + 0xc)) < g_invalidRoomDescriptorGuard) &&
|
|
(_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) {
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
|
|
(GHIDRA_CAST<RoomDescriptor *>((&g_roomDescriptorDummy)))->RoomDescriptor::constructor();
|
|
_atexit(FUN_00b15b30);
|
|
local_8 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_8))) + 0x1))) << 8;
|
|
_Init_thread_footer(&g_invalidRoomDescriptorGuard);
|
|
}
|
|
specialRoomDesc = &g_roomDescriptorDummy;
|
|
if (GHIDRA_UINT(this->_currentDimensionIdx) < 3) {
|
|
specialRoomDesc = this->_roomList + 0x1fc;
|
|
}
|
|
(GHIDRA_CAST<Seeds *>((GHIDRA_CAST<Seeds *>(specialRoomDesc))))->Seeds::Init3(rng);
|
|
seed = rng->_seed;
|
|
local_3b4 = (void *)0x0;
|
|
if (seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
seed = rng->_seed;
|
|
if (seed == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
seed = seed >> ((byte)(this->_generationRNG)._shift1 & 0x1f) ^ seed;
|
|
seed = seed << ((byte)(this->_generationRNG)._shift2 & 0x1f) ^ seed;
|
|
seed = seed >> ((byte)(this->_generationRNG)._shift3 & 0x1f) ^ seed;
|
|
rng->_seed = seed;
|
|
local_3b0 = RoomConfig::GetRandomRoom
|
|
(roomConfig,seed,1,0,3,0xd,0,-1,1,10,GHIDRA_CAST<uint *>(&local_3b4),0xffffffff,-1);
|
|
iVar4 = *GHIDRA_CAST<int *>(pvVar2);
|
|
if ((*GHIDRA_CAST<int *>((iVar4 + 0xc)) < g_invalidRoomDescriptorGuard) &&
|
|
(_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) {
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 2;
|
|
(GHIDRA_CAST<RoomDescriptor *>((&g_roomDescriptorDummy)))->RoomDescriptor::constructor();
|
|
_atexit(FUN_00b15b30);
|
|
local_8 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_8))) + 0x1))) << 8;
|
|
_Init_thread_footer(&g_invalidRoomDescriptorGuard);
|
|
}
|
|
specialRoomDesc = &g_roomDescriptorDummy;
|
|
if (GHIDRA_UINT(this->_currentDimensionIdx) < 3) {
|
|
specialRoomDesc = this->_roomList + 0x1fc;
|
|
}
|
|
specialRoomDesc->Data = local_3b0;
|
|
if ((*GHIDRA_CAST<int *>((iVar4 + 0xc)) < g_invalidRoomDescriptorGuard) &&
|
|
(_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) {
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 3;
|
|
(GHIDRA_CAST<RoomDescriptor *>((&g_roomDescriptorDummy)))->RoomDescriptor::constructor();
|
|
_atexit(FUN_00b15b30);
|
|
local_8 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_8))) + 0x1))) << 8;
|
|
_Init_thread_footer(&g_invalidRoomDescriptorGuard);
|
|
}
|
|
specialRoomDesc = &g_roomDescriptorDummy;
|
|
if (GHIDRA_UINT(this->_currentDimensionIdx) < 3) {
|
|
specialRoomDesc = this->_roomList + 0x200;
|
|
}
|
|
(GHIDRA_CAST<Seeds *>((GHIDRA_CAST<Seeds *>(specialRoomDesc))))->Seeds::Init3(rng);
|
|
seed = rng->_seed;
|
|
local_3b4 = (void *)0x0;
|
|
if (seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
seed = rng->_seed;
|
|
if (seed == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
seed = seed >> ((byte)(this->_generationRNG)._shift1 & 0x1f) ^ seed;
|
|
seed = seed << ((byte)(this->_generationRNG)._shift2 & 0x1f) ^ seed;
|
|
seed = seed >> ((byte)(this->_generationRNG)._shift3 & 0x1f) ^ seed;
|
|
rng->_seed = seed;
|
|
local_3b0 = RoomConfig::GetRandomRoom
|
|
(roomConfig,seed,1,0,0x16,0xd,0,-1,1,10,GHIDRA_CAST<uint *>(&local_3b4),0xffffffff,-1);
|
|
iVar4 = *GHIDRA_CAST<int *>(ThreadLocalStoragePointer);
|
|
if ((*GHIDRA_CAST<int *>((iVar4 + 0xc)) < g_invalidRoomDescriptorGuard) &&
|
|
(_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) {
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 4;
|
|
(GHIDRA_CAST<RoomDescriptor *>((&g_roomDescriptorDummy)))->RoomDescriptor::constructor();
|
|
_atexit(FUN_00b15b30);
|
|
local_8 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_8))) + 0x1))) << 8;
|
|
_Init_thread_footer(&g_invalidRoomDescriptorGuard);
|
|
}
|
|
specialRoomDesc = &g_roomDescriptorDummy;
|
|
if (GHIDRA_UINT(this->_currentDimensionIdx) < 3) {
|
|
specialRoomDesc = this->_roomList + 0x200;
|
|
}
|
|
specialRoomDesc->Data = local_3b0;
|
|
if ((*GHIDRA_CAST<int *>((iVar4 + 0xc)) < g_invalidRoomDescriptorGuard) &&
|
|
(_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) {
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 5;
|
|
(GHIDRA_CAST<RoomDescriptor *>((&g_roomDescriptorDummy)))->RoomDescriptor::constructor();
|
|
_atexit(FUN_00b15b30);
|
|
local_8 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_8))) + 0x1))) << 8;
|
|
_Init_thread_footer(&g_invalidRoomDescriptorGuard);
|
|
}
|
|
specialRoomDesc = &g_roomDescriptorDummy;
|
|
if (GHIDRA_UINT(this->_currentDimensionIdx) < 3) {
|
|
specialRoomDesc = this->_roomList + 0x1fe;
|
|
}
|
|
(GHIDRA_CAST<Seeds *>((GHIDRA_CAST<Seeds *>(specialRoomDesc))))->Seeds::Init3(rng);
|
|
seed = rng->_seed;
|
|
local_3b4 = (void *)0x0;
|
|
if (seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
seed = rng->_seed;
|
|
if (seed == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
seed = seed >> ((byte)(this->_generationRNG)._shift1 & 0x1f) ^ seed;
|
|
seed = seed << ((byte)(this->_generationRNG)._shift2 & 0x1f) ^ seed;
|
|
seed = seed >> ((byte)(this->_generationRNG)._shift3 & 0x1f) ^ seed;
|
|
rng->_seed = seed;
|
|
local_3b0 = RoomConfig::GetRandomRoom
|
|
(roomConfig,seed,1,0,0x10,0xd,0,-1,1,10,GHIDRA_CAST<uint *>(&local_3b4),0xffffffff,-1);
|
|
iVar4 = *GHIDRA_CAST<int *>(ThreadLocalStoragePointer);
|
|
if ((*GHIDRA_CAST<int *>((iVar4 + 0xc)) < g_invalidRoomDescriptorGuard) &&
|
|
(_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) {
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 6;
|
|
(GHIDRA_CAST<RoomDescriptor *>((&g_roomDescriptorDummy)))->RoomDescriptor::constructor();
|
|
_atexit(FUN_00b15b30);
|
|
local_8 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_8))) + 0x1))) << 8;
|
|
_Init_thread_footer(&g_invalidRoomDescriptorGuard);
|
|
}
|
|
specialRoomDesc = &g_roomDescriptorDummy;
|
|
if (GHIDRA_UINT(this->_currentDimensionIdx) < 3) {
|
|
specialRoomDesc = this->_roomList + 0x1fe;
|
|
}
|
|
specialRoomDesc->Data = local_3b0;
|
|
if ((*GHIDRA_CAST<int *>((iVar4 + 0xc)) < g_invalidRoomDescriptorGuard) &&
|
|
(_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) {
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 7;
|
|
(GHIDRA_CAST<RoomDescriptor *>((&g_roomDescriptorDummy)))->RoomDescriptor::constructor();
|
|
_atexit(FUN_00b15b30);
|
|
local_8 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_8))) + 0x1))) << 8;
|
|
_Init_thread_footer(&g_invalidRoomDescriptorGuard);
|
|
}
|
|
specialRoomDesc = &g_roomDescriptorDummy;
|
|
if (GHIDRA_UINT(this->_currentDimensionIdx) < 3) {
|
|
specialRoomDesc = this->_roomList + 0x204;
|
|
}
|
|
(GHIDRA_CAST<Seeds *>((GHIDRA_CAST<Seeds *>(specialRoomDesc))))->Seeds::Init3(rng);
|
|
pRVar3 = RoomConfig::GetRoomByStageTypeAndVariant(roomConfig,0x23,0x10,0x29a,-1);
|
|
if ((*GHIDRA_CAST<int *>((iVar4 + 0xc)) < g_invalidRoomDescriptorGuard) &&
|
|
(_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) {
|
|
local_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),8);
|
|
(GHIDRA_CAST<RoomDescriptor *>((&g_roomDescriptorDummy)))->RoomDescriptor::constructor();
|
|
_atexit(FUN_00b15b30);
|
|
_Init_thread_footer(&g_invalidRoomDescriptorGuard);
|
|
}
|
|
if (GHIDRA_UINT(this->_currentDimensionIdx) < 3) {
|
|
specialRoomDesc = this->_roomList + 0x204;
|
|
}
|
|
else {
|
|
specialRoomDesc = &g_roomDescriptorDummy;
|
|
}
|
|
specialRoomDesc->Data = pRVar3;
|
|
FID_conflict__Tidy(local_30);
|
|
FID_conflict__Tidy(local_3c);
|
|
vector_LevelGenerator_Room_tidy(local_48);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00753c50
|
|
void Game::SetLastLevelWithDamage(int stage)
|
|
{
|
|
int clampedLevel;
|
|
|
|
if (stage < 1) {
|
|
stage = 0;
|
|
}
|
|
clampedLevel = 0xd;
|
|
if (stage < 0xd) {
|
|
clampedLevel = stage;
|
|
}
|
|
this->_lastLevelWithDamage = clampedLevel;
|
|
return;
|
|
}
|
|
|
|
// 00753c80
|
|
void Game::SetLastLevelWithoutHalfHp(int level)
|
|
{
|
|
int clampedLevel;
|
|
|
|
if (level < 1) {
|
|
level = 0;
|
|
}
|
|
clampedLevel = 0xd;
|
|
if (level < 0xd) {
|
|
clampedLevel = level;
|
|
}
|
|
this->_lastLevelWithoutHalfHp = clampedLevel;
|
|
return;
|
|
}
|
|
|
|
// 00753cb0
|
|
int Game::GetLastLevelWithoutHalfHp()
|
|
{
|
|
return this->_lastLevelWithoutHalfHp;
|
|
}
|
|
|
|
// 00753cc0
|
|
void Game::AddPixelation(int duration)
|
|
{
|
|
int *longerDuration;
|
|
int newDuration;
|
|
|
|
longerDuration = &duration;
|
|
if (duration <= this->_pixelationTimer) {
|
|
longerDuration = &this->_pixelationTimer;
|
|
}
|
|
newDuration = *longerDuration;
|
|
this->_pixelationTimer = newDuration;
|
|
this->_pixelationDuration = newDuration;
|
|
return;
|
|
}
|
|
|
|
// 00753d00
|
|
void Game::ShowRule()
|
|
{
|
|
ShowFortuneText(&this->_fortuneRNG,GHIDRA_CAST<byte *>("Fortune_Rules"));
|
|
return;
|
|
}
|
|
|
|
// 007cfba0
|
|
void Game::render_debug_player_info(Entity_Player *debugPlayer, Vector *pos)
|
|
{
|
|
uint uVar1;
|
|
void *quad;
|
|
void *quad_00;
|
|
byte *roomTypeName;
|
|
void *quad_01;
|
|
float *historyPos;
|
|
void *quad_02;
|
|
int iVar2;
|
|
void *extraout_EAX;
|
|
void *pvVar3;
|
|
void *colorQuads;
|
|
void *extraout_EAX_00;
|
|
undefined4 *puVar4;
|
|
void *colorQuads_00;
|
|
void *colorQuads_01;
|
|
void *colorQuads_02;
|
|
void *colorQuads_03;
|
|
std_string *psVar5;
|
|
void *colorQuads_04;
|
|
void *quad_03;
|
|
int iVar6;
|
|
void *quad_04;
|
|
void *quad_05;
|
|
void *quad_06;
|
|
void *quad_07;
|
|
void *quad_08;
|
|
void *quad_09;
|
|
undefined4 extraout_ECX;
|
|
undefined4 extraout_ECX_00;
|
|
byte *labelText;
|
|
undefined4 extraout_ECX_01;
|
|
undefined4 extraout_ECX_02;
|
|
int unused;
|
|
int unused_00;
|
|
int unused_01;
|
|
int unused_02;
|
|
int unused_03;
|
|
int unused_04;
|
|
int unused_05;
|
|
int unused_06;
|
|
undefined4 extraout_ECX_03;
|
|
undefined4 extraout_ECX_04;
|
|
undefined4 extraout_ECX_05;
|
|
undefined4 extraout_ECX_06;
|
|
undefined4 extraout_ECX_07;
|
|
undefined4 extraout_ECX_08;
|
|
undefined4 extraout_ECX_09;
|
|
undefined4 extraout_ECX_10;
|
|
undefined4 *******pppppppuVar7;
|
|
Entity_Player *player;
|
|
float10 textWidth;
|
|
float fVar8;
|
|
char *ptr;
|
|
undefined1 bgQuad [112];
|
|
KColor bgColor;
|
|
float local_b8;
|
|
Entity_Player *local_b4;
|
|
float local_b0;
|
|
StringTable *local_ac;
|
|
Vector local_a8;
|
|
Vector *local_a0;
|
|
float local_9c;
|
|
int local_98;
|
|
KColor textColor;
|
|
Vector local_80;
|
|
byte isStringFound;
|
|
Vector rowSize;
|
|
Vector linePos;
|
|
float lineY;
|
|
std_string bitsText;
|
|
undefined4 local_48;
|
|
undefined4 local_44;
|
|
undefined4 local_40;
|
|
undefined4 *******local_3c;
|
|
undefined4 local_38;
|
|
undefined4 local_34;
|
|
undefined4 local_30;
|
|
undefined4 local_2c;
|
|
uint local_28;
|
|
uint local_24;
|
|
undefined1 *puStack_20;
|
|
void *local_1c;
|
|
undefined1 *puStack_18;
|
|
undefined4 local_14;
|
|
undefined *diffFormat;
|
|
Game *game;
|
|
undefined4 historyStage;
|
|
undefined4 historyStageType;
|
|
undefined4 historyTime;
|
|
|
|
game = g_game;
|
|
puStack_20 = GHIDRA_CAST<undefined1 *>((GHIDRA_INT(register0x00000010) + -4));
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00b0027d;
|
|
local_1c = ExceptionList;
|
|
uVar1 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 0x10U;
|
|
ExceptionList = &local_1c;
|
|
bgColor._red = 0.0;
|
|
bgColor._green = 0.0;
|
|
bgColor._blue = 0.0;
|
|
bgColor._alpha = 0.5;
|
|
local_a0 = pos;
|
|
local_9c = pos->x;
|
|
linePos.y = pos->y;
|
|
bgColor._unk = 0;
|
|
local_b4 = debugPlayer;
|
|
linePos.x = local_9c;
|
|
lineY = linePos.y;
|
|
local_24 = uVar1;
|
|
fVar8 = (GHIDRA_CAST<RoomTransition *>((&g_game->_roomTransition)))->RoomTransition::get_hud_alpha();
|
|
if ((fVar8 * *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((game->_minimap))) + 0x2d0)))) <= 0.0) ||
|
|
(((game->_minimap)._config[1]._size2.y - (game->_minimap)._config[1]._size1.y == 47.0 &&
|
|
((game->_minimap)._config[1]._alpha - (game->_minimap)._config[1]._size2.x == 47.0)))) {
|
|
local_80.x = 120.0;
|
|
local_80.y = 7.0;
|
|
render_quad_set_rect(bgQuad,&linePos,&local_80,&bgColor);
|
|
render_color_shader_pass(quad_02);
|
|
(GHIDRA_CAST<KColor *>((&textColor)))->KColor::SetFromARGB(0xffffffff);
|
|
FUN_007cf9a0(&linePos,extraout_ECX_01,"Player items",uVar1);
|
|
linePos.y = lineY + 3.0;
|
|
lineY = linePos.y;
|
|
(GHIDRA_CAST<KColor *>((&textColor)))->KColor::SetFromARGB(0xffffffff);
|
|
FUN_007cf9a0(&linePos,extraout_ECX_02,"_____________________");
|
|
linePos.y = lineY + 8.0;
|
|
uVar1 = 0;
|
|
pvVar3 = (debugPlayer->_collectibleCounts)._begin;
|
|
lineY = linePos.y;
|
|
if (GHIDRA_INT((debugPlayer->_collectibleCounts)._end) - GHIDRA_INT(pvVar3) >> 2 != 0) {
|
|
do {
|
|
local_98 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + uVar1 * 4));
|
|
iVar2 = (GHIDRA_CAST<Entity_Player *>((debugPlayer)))->Entity_Player::GetCollectibleNum(uVar1,0);
|
|
if ((iVar2 != 0) || (local_98 != 0)) {
|
|
local_ac = GHIDRA_CAST<StringTable *>(FUN_007cfa90());
|
|
local_80.x = local_9c;
|
|
local_80.y = lineY;
|
|
rowSize.x = 120.0;
|
|
rowSize.y = 7.0;
|
|
render_quad_set_rect(bgQuad,&linePos,&rowSize,&bgColor);
|
|
if ((*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(extraout_EAX) + 0x40)) + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(extraout_EAX) + 0x2c)) +
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(extraout_EAX) + 0x54)) + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(extraout_EAX) + 0x68))) * 0.25
|
|
!= 0.0) {
|
|
local_a8.y = (float)extraout_EAX;
|
|
shader_push(GHIDRA_CAST<byte *>("KAGE_ColorShader"));
|
|
local_38 = 0;
|
|
local_48 = 0;
|
|
local_3c = GHIDRA_CAST<undefined4 *******>(0x0);
|
|
local_44 = 0;
|
|
local_30 = 0x3f800000;
|
|
local_40 = 0x3f800000;
|
|
local_2c = 0x3f800000;
|
|
local_34 = 0x3f800000;
|
|
local_28 = local_28 & 0xffffff00;
|
|
pvVar3 = kage_graphics_flush((void *)0x0);
|
|
render_quad_draw(pvVar3,&local_48,(void *)local_a8.y,1,unused);
|
|
FUN_00a14200();
|
|
}
|
|
textColor._unk = 0;
|
|
textColor._red = 1.0;
|
|
textColor._green = 1.0;
|
|
textColor._blue = 1.0;
|
|
textColor._alpha = 1.0;
|
|
textWidth = (float10)FUN_007cf9a0(&local_80,&textColor,"%s: %d",local_ac,local_98);
|
|
local_80.x = (float)(textWidth + (float10)linePos.x);
|
|
if (local_98 < iVar2) {
|
|
(GHIDRA_CAST<KColor *>((&textColor)))->KColor::SetFromARGB(0xff00ff00);
|
|
diffFormat = &DAT_00b6b898;
|
|
LAB_007d021d:
|
|
FUN_007cf9a0(&local_80,&textColor,diffFormat,iVar2 - local_98);
|
|
}
|
|
else if (iVar2 < local_98) {
|
|
(GHIDRA_CAST<KColor *>((&textColor)))->KColor::SetFromARGB(0xffff0000);
|
|
diffFormat = &DAT_00b6b834;
|
|
goto LAB_007d021d;
|
|
}
|
|
linePos.y = lineY + 8.0;
|
|
lineY = linePos.y;
|
|
}
|
|
uVar1 = uVar1 + 1;
|
|
pvVar3 = (local_b4->_collectibleCounts)._begin;
|
|
debugPlayer = local_b4;
|
|
} while (uVar1 < GHIDRA_UINT((GHIDRA_INT((local_b4->_collectibleCounts)._end) - GHIDRA_INT(pvVar3) >> 2)));
|
|
}
|
|
fVar8 = 0.0;
|
|
rowSize.x = 120.0;
|
|
rowSize.y = 7.0;
|
|
linePos.x = local_a0->x + 128.0;
|
|
linePos.y = local_a0->y + 0.0;
|
|
lineY = linePos.y;
|
|
render_quad_set_rect(bgQuad,&linePos,&rowSize,&bgColor);
|
|
if ((*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(colorQuads) + 0x40)) + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(colorQuads) + 0x2c)) +
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(colorQuads) + 0x54)) + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(colorQuads) + 0x68))) * 0.25 != fVar8) {
|
|
shader_push(GHIDRA_CAST<byte *>("KAGE_ColorShader"));
|
|
local_38 = 0;
|
|
local_48 = 0;
|
|
local_3c = GHIDRA_CAST<undefined4 *******>(0x0);
|
|
local_44 = 0;
|
|
local_30 = 0x3f800000;
|
|
local_40 = 0x3f800000;
|
|
local_2c = 0x3f800000;
|
|
local_34 = 0x3f800000;
|
|
local_28 = local_28 & 0xffffff00;
|
|
pvVar3 = kage_graphics_flush((void *)0x0);
|
|
render_quad_draw(pvVar3,&local_48,colorQuads,1,unused_00);
|
|
FUN_00a14200();
|
|
}
|
|
textColor._unk = 0;
|
|
textColor._red = 1.0;
|
|
textColor._green = 1.0;
|
|
textColor._blue = 1.0;
|
|
textColor._alpha = 1.0;
|
|
FUN_007cf9a0(&linePos,&textColor,"Player effects");
|
|
linePos.y = lineY + 3.0;
|
|
textColor._unk = 0;
|
|
textColor._red = 1.0;
|
|
textColor._green = 1.0;
|
|
textColor._blue = 1.0;
|
|
textColor._alpha = 1.0;
|
|
lineY = linePos.y;
|
|
FUN_007cf9a0(&linePos,&textColor,"_____________________");
|
|
lineY = lineY + 8.0;
|
|
local_a8.y = (float)(debugPlayer->_temporaryeffects)._effects._begin;
|
|
local_9c = 0.0;
|
|
if (GHIDRA_INT((debugPlayer->_temporaryeffects)._effects._end) - GHIDRA_INT(local_a8.y) >> 4 != 0) {
|
|
rowSize.x = 120.0;
|
|
rowSize.y = 7.0;
|
|
local_98 = 0;
|
|
do {
|
|
pvVar3 = (void *)local_a8.y;
|
|
linePos.y = lineY;
|
|
local_80.y = (float)FUN_007cfa90();
|
|
iVar2 = 0xff;
|
|
textColor._unk = 0;
|
|
textColor._red = 1.0;
|
|
textColor._green = 1.0;
|
|
textColor._alpha = 1.0;
|
|
if (*GHIDRA_CAST<char *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + local_98)) + 0xb4)) != '\0') {
|
|
iVar2 = 0;
|
|
}
|
|
textColor._blue = ((float)iVar2 + 0.0) / 255.0;
|
|
render_quad_set_rect(bgQuad,&linePos,&rowSize,&bgColor);
|
|
local_ac = extraout_EAX_00;
|
|
if ((*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(extraout_EAX_00) + 0x40)) + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(extraout_EAX_00) + 0x2c)) +
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(extraout_EAX_00) + 0x54)) + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(extraout_EAX_00) + 0x68))) *
|
|
0.25 != 0.0) {
|
|
shader_push(GHIDRA_CAST<byte *>("KAGE_ColorShader"));
|
|
local_38 = 0;
|
|
local_48 = 0;
|
|
local_3c = GHIDRA_CAST<undefined4 *******>(0x0);
|
|
local_44 = 0;
|
|
local_30 = 0x3f800000;
|
|
local_40 = 0x3f800000;
|
|
local_2c = 0x3f800000;
|
|
local_34 = 0x3f800000;
|
|
local_28 = local_28 & 0xffffff00;
|
|
pvVar3 = kage_graphics_flush((void *)0x0);
|
|
render_quad_draw(pvVar3,&local_48,local_ac,1,unused_01);
|
|
if (g_shaderStackSize == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Shader stack empty\n"));
|
|
}
|
|
uVar1 = g_shaderStackSize;
|
|
puVar4 = GHIDRA_CAST<undefined4 *>(FUN_00684fc0());
|
|
g_shaderStackSize = uVar1 - 1;
|
|
g_currentShader = (void *)*puVar4;
|
|
if (g_shaderStackSize == 0) {
|
|
DAT_00c379d8 = 0;
|
|
}
|
|
pvVar3 = (void *)local_a8.y;
|
|
}
|
|
FUN_007cf9a0(&linePos,&textColor,"%s x%d: %d",local_80.y,
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar3) + local_98 + 4)),
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar3) + local_98 + 8)));
|
|
lineY = lineY + 8.0;
|
|
local_a8.y = (float)(debugPlayer->_temporaryeffects)._effects._begin;
|
|
local_9c = (float)(GHIDRA_INT(local_9c) + 1);
|
|
local_98 = local_98 + 0x10;
|
|
} while (GHIDRA_UINT(local_9c) <
|
|
GHIDRA_UINT((GHIDRA_INT((debugPlayer->_temporaryeffects)._effects._end) - GHIDRA_INT(local_a8.y) >> 4)));
|
|
}
|
|
local_a8.y = 0.0;
|
|
local_ac = GHIDRA_CAST<StringTable *>((GHIDRA_INT(g_game->_room) + 0x7314));
|
|
iVar2 = *GHIDRA_CAST<int *>(local_ac);
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0x7318)) - iVar2 >> 4 != 0) {
|
|
rowSize.x = 120.0;
|
|
rowSize.y = 7.0;
|
|
local_9c = 0.0;
|
|
do {
|
|
linePos.y = lineY;
|
|
local_80.y = (float)FUN_007cfa90();
|
|
render_quad_set_rect(bgQuad,&linePos,&rowSize,&bgColor);
|
|
if ((*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(colorQuads_00) + 0x40)) + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(colorQuads_00) + 0x2c)) +
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(colorQuads_00) + 0x54)) + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(colorQuads_00) + 0x68))) * 0.25
|
|
!= 0.0) {
|
|
shader_push(GHIDRA_CAST<byte *>("KAGE_ColorShader"));
|
|
local_38 = 0;
|
|
local_48 = 0;
|
|
local_3c = GHIDRA_CAST<undefined4 *******>(0x0);
|
|
local_44 = 0;
|
|
local_30 = 0x3f800000;
|
|
local_40 = 0x3f800000;
|
|
local_2c = 0x3f800000;
|
|
local_34 = 0x3f800000;
|
|
local_28 = local_28 & 0xffffff00;
|
|
pvVar3 = kage_graphics_flush((void *)0x0);
|
|
render_quad_draw(pvVar3,&local_48,colorQuads_00,1,unused_02);
|
|
if (g_shaderStackSize == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Shader stack empty\n"));
|
|
}
|
|
uVar1 = g_shaderStackSize;
|
|
puVar4 = GHIDRA_CAST<undefined4 *>(FUN_00684fc0());
|
|
g_shaderStackSize = uVar1 - 1;
|
|
g_currentShader = (void *)*puVar4;
|
|
if (g_shaderStackSize == 0) {
|
|
DAT_00c379d8 = 0;
|
|
}
|
|
}
|
|
fVar8 = local_9c;
|
|
textColor._unk = 0;
|
|
textColor._red = 0.0;
|
|
textColor._green = 1.0;
|
|
textColor._blue = 1.0;
|
|
textColor._alpha = 1.0;
|
|
FUN_007cf9a0(&linePos,&textColor,"[R] %s x%d: %d",local_80.y,
|
|
*GHIDRA_CAST<undefined4 *>((iVar2 + 4 + GHIDRA_INT(local_9c))),
|
|
*GHIDRA_CAST<undefined4 *>((iVar2 + 8 + GHIDRA_INT(local_9c))));
|
|
local_9c = (float)(GHIDRA_INT(fVar8) + 0x10);
|
|
lineY = lineY + 8.0;
|
|
iVar2 = *GHIDRA_CAST<int *>(local_ac);
|
|
local_a8.y = (float)(GHIDRA_INT(local_a8.y) + 1);
|
|
} while (GHIDRA_UINT(local_a8.y) < GHIDRA_UINT((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_ac)) + 0x4)))) - iVar2 >> 4)));
|
|
debugPlayer = local_b4;
|
|
}
|
|
fVar8 = 0.0;
|
|
rowSize.x = 120.0;
|
|
rowSize.y = 7.0;
|
|
linePos.x = local_a0->x + 256.0;
|
|
linePos.y = local_a0->y + 0.0;
|
|
lineY = linePos.y;
|
|
render_quad_set_rect(bgQuad,&linePos,&rowSize,&bgColor);
|
|
if ((*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(colorQuads_01) + 0x40)) + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(colorQuads_01) + 0x2c)) +
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(colorQuads_01) + 0x54)) + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(colorQuads_01) + 0x68))) * 0.25 !=
|
|
fVar8) {
|
|
shader_push(GHIDRA_CAST<byte *>("KAGE_ColorShader"));
|
|
local_38 = 0;
|
|
local_48 = 0;
|
|
local_3c = GHIDRA_CAST<undefined4 *******>(0x0);
|
|
local_44 = 0;
|
|
local_30 = 0x3f800000;
|
|
local_40 = 0x3f800000;
|
|
local_2c = 0x3f800000;
|
|
local_34 = 0x3f800000;
|
|
local_28 = local_28 & 0xffffff00;
|
|
pvVar3 = kage_graphics_flush((void *)0x0);
|
|
render_quad_draw(pvVar3,&local_48,colorQuads_01,1,unused_03);
|
|
if (g_shaderStackSize == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Shader stack empty\n"));
|
|
}
|
|
uVar1 = g_shaderStackSize;
|
|
puVar4 = GHIDRA_CAST<undefined4 *>(FUN_00684fc0());
|
|
g_shaderStackSize = uVar1 - 1;
|
|
g_currentShader = (void *)*puVar4;
|
|
if (g_shaderStackSize == 0) {
|
|
DAT_00c379d8 = 0;
|
|
}
|
|
}
|
|
textColor._unk = 0;
|
|
textColor._red = 1.0;
|
|
textColor._green = 1.0;
|
|
textColor._blue = 1.0;
|
|
textColor._alpha = 1.0;
|
|
FUN_007cf9a0(&linePos,&textColor,"Hearts: %d(%d rotten)/%d(+%d bone)",debugPlayer->_redHearts,
|
|
debugPlayer->_rottenHearts,debugPlayer->_maxHearts,debugPlayer->_boneHearts);
|
|
linePos.y = lineY + 8.0;
|
|
rowSize.x = 120.0;
|
|
rowSize.y = 7.0;
|
|
lineY = linePos.y;
|
|
render_quad_set_rect(bgQuad,&linePos,&rowSize,&bgColor);
|
|
if ((*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(colorQuads_02) + 0x40)) + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(colorQuads_02) + 0x2c)) +
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(colorQuads_02) + 0x54)) + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(colorQuads_02) + 0x68))) * 0.25 !=
|
|
0.0) {
|
|
shader_push(GHIDRA_CAST<byte *>("KAGE_ColorShader"));
|
|
local_38 = 0;
|
|
local_48 = 0;
|
|
local_3c = GHIDRA_CAST<undefined4 *******>(0x0);
|
|
local_44 = 0;
|
|
local_30 = 0x3f800000;
|
|
local_40 = 0x3f800000;
|
|
local_2c = 0x3f800000;
|
|
local_34 = 0x3f800000;
|
|
local_28 = local_28 & 0xffffff00;
|
|
pvVar3 = kage_graphics_flush((void *)0x0);
|
|
render_quad_draw(pvVar3,&local_48,colorQuads_02,1,unused_04);
|
|
if (g_shaderStackSize == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Shader stack empty\n"));
|
|
}
|
|
uVar1 = g_shaderStackSize;
|
|
puVar4 = GHIDRA_CAST<undefined4 *>(FUN_00684fc0());
|
|
g_shaderStackSize = uVar1 - 1;
|
|
g_currentShader = (void *)*puVar4;
|
|
if (g_shaderStackSize == 0) {
|
|
DAT_00c379d8 = 0;
|
|
}
|
|
}
|
|
iVar2 = debugPlayer->_eternalHearts;
|
|
iVar6 = debugPlayer->_soulHearts;
|
|
textColor._unk = 0;
|
|
textColor._red = 1.0;
|
|
textColor._green = 1.0;
|
|
textColor._blue = 1.0;
|
|
textColor._alpha = 1.0;
|
|
FUN_007cf9a0(&linePos,&textColor," + %d soul + %d eternal",iVar6,iVar2);
|
|
linePos.y = lineY + 8.0;
|
|
local_80.y = (float)debugPlayer->_blackHearts;
|
|
lineY = linePos.y;
|
|
std::bitset<32>::to_string(&bitsText,iVar6,iVar2);
|
|
local_14 = 0;
|
|
rowSize.x = 120.0;
|
|
rowSize.y = 7.0;
|
|
render_quad_set_rect(bgQuad,&linePos,&rowSize,&bgColor);
|
|
if ((*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(colorQuads_03) + 0x40)) + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(colorQuads_03) + 0x2c)) +
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(colorQuads_03) + 0x54)) + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(colorQuads_03) + 0x68))) * 0.25 !=
|
|
0.0) {
|
|
shader_push(GHIDRA_CAST<byte *>("KAGE_ColorShader"));
|
|
local_38 = 0;
|
|
local_48 = 0;
|
|
local_3c = GHIDRA_CAST<undefined4 *******>(0x0);
|
|
local_44 = 0;
|
|
local_30 = 0x3f800000;
|
|
local_40 = 0x3f800000;
|
|
local_2c = 0x3f800000;
|
|
local_34 = 0x3f800000;
|
|
local_28 = local_28 & 0xffffff00;
|
|
pvVar3 = kage_graphics_flush((void *)0x0);
|
|
render_quad_draw(pvVar3,&local_48,colorQuads_03,1,unused_05);
|
|
if (g_shaderStackSize == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Shader stack empty\n"));
|
|
}
|
|
uVar1 = g_shaderStackSize;
|
|
puVar4 = GHIDRA_CAST<undefined4 *>(FUN_00684fc0());
|
|
g_shaderStackSize = uVar1 - 1;
|
|
g_currentShader = (void *)*puVar4;
|
|
if (g_shaderStackSize == 0) {
|
|
DAT_00c379d8 = 0;
|
|
}
|
|
}
|
|
psVar5 = &bitsText;
|
|
if (0xf < bitsText._capacity) {
|
|
psVar5 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(bitsText._buf))) + 0x0)));
|
|
}
|
|
local_2c = 0;
|
|
local_28 = 0xf;
|
|
local_3c = GHIDRA_CAST<undefined4 *******>(0x0);
|
|
std::string::append_reversed(psVar5->_buf + bitsText._size,psVar5,local_80.y);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 1;
|
|
pppppppuVar7 = &local_3c;
|
|
if (0xf < local_28) {
|
|
pppppppuVar7 = local_3c;
|
|
}
|
|
ptr = "Black hearts: %s";
|
|
textColor._unk = 0;
|
|
textColor._red = 1.0;
|
|
textColor._green = 1.0;
|
|
textColor._blue = 1.0;
|
|
textColor._alpha = 1.0;
|
|
FUN_007cf9a0(&linePos,&textColor,"Black hearts: %s",pppppppuVar7);
|
|
local_14 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8;
|
|
if (0xf < local_28) {
|
|
pppppppuVar7 = GHIDRA_CAST<undefined4 *******>((local_28 + 1));
|
|
ptr = GHIDRA_CAST<char *>(local_3c);
|
|
if (GHIDRA_CAST<undefined4 *******>(0xfff) < pppppppuVar7) {
|
|
ptr = GHIDRA_CAST<char *>(local_3c[-1]);
|
|
pppppppuVar7 = GHIDRA_CAST<undefined4 *******>((local_28 + 0x24));
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(local_3c) + (-4 - GHIDRA_INT(ptr))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(ptr,GHIDRA_UINT(pppppppuVar7));
|
|
}
|
|
linePos.y = lineY + 8.0;
|
|
local_80.y = (float)debugPlayer->_boneHearts;
|
|
lineY = linePos.y;
|
|
psVar5 = GHIDRA_CAST<std_string *>(std)::bitset<32>::to_string(&local_3c,ptr,pppppppuVar7);
|
|
if (&bitsText != psVar5) {
|
|
(GHIDRA_CAST<std::string *>((bitsText._buf)))->std::string::_Tidy_deallocate();
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(bitsText._buf)) + 0x0))) = *GHIDRA_CAST<undefined4 *>(psVar5->_buf);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(bitsText._buf)) + 0x4))) = *GHIDRA_CAST<undefined4 *>((psVar5->_buf + 4));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(bitsText._buf)) + 0x8))) = *GHIDRA_CAST<undefined4 *>((psVar5->_buf + 8));
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(bitsText._buf)) + 0xc))) = *GHIDRA_CAST<undefined4 *>((psVar5->_buf + 0xc));
|
|
bitsText._size = psVar5->_size;
|
|
bitsText._capacity = psVar5->_capacity;
|
|
psVar5->_size = 0;
|
|
psVar5->_capacity = 0xf;
|
|
psVar5->_buf[0] = '\0';
|
|
}
|
|
if (0xf < local_28) {
|
|
uVar1 = local_28 + 1;
|
|
pppppppuVar7 = local_3c;
|
|
if (0xfff < uVar1) {
|
|
pppppppuVar7 = GHIDRA_CAST<undefined4 *******>(local_3c[-1]);
|
|
uVar1 = local_28 + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(local_3c) + (-4 - GHIDRA_INT(pppppppuVar7))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pppppppuVar7,uVar1);
|
|
}
|
|
rowSize.x = 120.0;
|
|
rowSize.y = 7.0;
|
|
render_quad_set_rect(bgQuad,&linePos,&rowSize,&bgColor);
|
|
if ((*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(colorQuads_04) + 0x40)) + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(colorQuads_04) + 0x2c)) +
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(colorQuads_04) + 0x54)) + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(colorQuads_04) + 0x68))) * 0.25 !=
|
|
0.0) {
|
|
shader_push(GHIDRA_CAST<byte *>("KAGE_ColorShader"));
|
|
local_38 = 0;
|
|
local_48 = 0;
|
|
local_3c = GHIDRA_CAST<undefined4 *******>(0x0);
|
|
local_44 = 0;
|
|
local_30 = 0x3f800000;
|
|
local_40 = 0x3f800000;
|
|
local_2c = 0x3f800000;
|
|
local_34 = 0x3f800000;
|
|
local_28 = local_28 & 0xffffff00;
|
|
pvVar3 = kage_graphics_flush((void *)0x0);
|
|
render_quad_draw(pvVar3,&local_48,colorQuads_04,1,unused_06);
|
|
FUN_00a14200();
|
|
}
|
|
psVar5 = &bitsText;
|
|
if (0xf < bitsText._capacity) {
|
|
psVar5 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(bitsText._buf))) + 0x0)));
|
|
}
|
|
local_2c = 0;
|
|
local_28 = 0xf;
|
|
local_3c = GHIDRA_CAST<undefined4 *******>(0x0);
|
|
std::string::append_reversed(psVar5->_buf + bitsText._size,psVar5,local_80.y);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
|
|
pppppppuVar7 = &local_3c;
|
|
if (0xf < local_28) {
|
|
pppppppuVar7 = local_3c;
|
|
}
|
|
(GHIDRA_CAST<KColor *>((&textColor)))->KColor::SetFromARGB(0xffffffff);
|
|
FUN_007cf9a0(&linePos,extraout_ECX_03,"Bone hearts.: %s",pppppppuVar7);
|
|
local_14 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8;
|
|
if (0xf < local_28) {
|
|
uVar1 = local_28 + 1;
|
|
pppppppuVar7 = local_3c;
|
|
if (0xfff < uVar1) {
|
|
pppppppuVar7 = GHIDRA_CAST<undefined4 *******>(local_3c[-1]);
|
|
uVar1 = local_28 + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(local_3c) + (-4 - GHIDRA_INT(pppppppuVar7))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pppppppuVar7,uVar1);
|
|
}
|
|
linePos.y = lineY + 8.0;
|
|
rowSize.x = 120.0;
|
|
rowSize.y = 7.0;
|
|
lineY = linePos.y;
|
|
render_quad_set_rect(bgQuad,&linePos,&rowSize,&bgColor);
|
|
render_color_shader_pass(quad_03);
|
|
local_80.y = (float)debugPlayer->_brokenHearts;
|
|
iVar2 = (GHIDRA_CAST<Entity_Player *>((debugPlayer)))->Entity_Player::GetHeartLimit(1);
|
|
iVar6 = (GHIDRA_CAST<Entity_Player *>((local_b4)))->Entity_Player::GetHeartLimit(0);
|
|
(GHIDRA_CAST<KColor *>((&textColor)))->KColor::SetFromARGB(0xffffffff);
|
|
FUN_007cf9a0(&linePos,extraout_ECX_04,"Heart limit: %d (base:%d, broken:%d)\n",iVar6,iVar2,
|
|
local_80.y);
|
|
linePos.y = lineY + 8.0;
|
|
rowSize.x = 120.0;
|
|
rowSize.y = 7.0;
|
|
lineY = linePos.y;
|
|
render_quad_set_rect(bgQuad,&linePos,&rowSize,&bgColor);
|
|
render_color_shader_pass(quad_04);
|
|
(GHIDRA_CAST<KColor *>((&textColor)))->KColor::SetFromARGB(0xffffffff);
|
|
player = local_b4;
|
|
FUN_007cf9a0(&linePos,extraout_ECX_05,"Golden hearts: %d",local_b4->_goldenHearts);
|
|
linePos.y = lineY + 8.0;
|
|
rowSize.x = 120.0;
|
|
rowSize.y = 7.0;
|
|
lineY = linePos.y;
|
|
render_quad_set_rect(bgQuad,&linePos,&rowSize,&bgColor);
|
|
render_color_shader_pass(quad_05);
|
|
(GHIDRA_CAST<KColor *>((&textColor)))->KColor::SetFromARGB(0xffffffff);
|
|
FUN_007cf9a0(&linePos,extraout_ECX_06,"Strength HP given: %d",player->_strengthMaxHearts);
|
|
linePos.y = lineY + 8.0;
|
|
rowSize.x = 120.0;
|
|
rowSize.y = 7.0;
|
|
lineY = linePos.y;
|
|
render_quad_set_rect(bgQuad,&linePos,&rowSize,&bgColor);
|
|
render_color_shader_pass(quad_06);
|
|
(GHIDRA_CAST<KColor *>((&textColor)))->KColor::SetFromARGB(0xffffffff);
|
|
FUN_007cf9a0(&linePos,extraout_ECX_07,"HP overflow from items: %d",
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((player)) + 0x1950)))));
|
|
linePos.y = lineY + 8.0;
|
|
rowSize.x = 120.0;
|
|
rowSize.y = 7.0;
|
|
lineY = linePos.y;
|
|
render_quad_set_rect(bgQuad,&linePos,&rowSize,&bgColor);
|
|
render_color_shader_pass(quad_07);
|
|
(GHIDRA_CAST<KColor *>((&textColor)))->KColor::SetFromARGB(0xffffffff);
|
|
FUN_007cf9a0(&linePos,extraout_ECX_08,"Greed\'s Gullet: %d (overflow:%d)",
|
|
GHIDRA_INT(player->_greedsGulletHearts),GHIDRA_INT(player->_greedsGulletOverflow));
|
|
linePos.y = lineY + 8.0;
|
|
rowSize.x = 120.0;
|
|
rowSize.y = 7.0;
|
|
lineY = linePos.y;
|
|
render_quad_set_rect(bgQuad,&linePos,&rowSize,&bgColor);
|
|
render_color_shader_pass(quad_08);
|
|
(GHIDRA_CAST<KColor *>((&textColor)))->KColor::SetFromARGB(0xffffffff);
|
|
FUN_007cf9a0(&linePos,extraout_ECX_09,&s_empty);
|
|
linePos.y = lineY + 8.0;
|
|
uVar1 = 0;
|
|
lineY = linePos.y;
|
|
do {
|
|
if ((GHIDRA_INT(uVar1) < 0) ||
|
|
(pvVar3 = (g_manager->_itemConfig)._playerForms._begin,
|
|
GHIDRA_INT((g_manager->_itemConfig)._playerForms._end) - GHIDRA_INT(pvVar3) >> 2 <= GHIDRA_INT(uVar1))) {
|
|
local_a0 = GHIDRA_CAST<Vector *>(0x0);
|
|
}
|
|
else {
|
|
local_a0 = *GHIDRA_CAST<Vector **>((GHIDRA_CAST<char *>(pvVar3) + uVar1 * 4));
|
|
}
|
|
if (local_a0 != GHIDRA_CAST<Vector *>(0x0)) {
|
|
rowSize.x = 120.0;
|
|
rowSize.y = 7.0;
|
|
render_quad_set_rect(bgQuad,&linePos,&rowSize,&bgColor);
|
|
render_color_shader_pass(quad_09);
|
|
local_a8.y = (float)player->_playerForms[uVar1];
|
|
labelText = GHIDRA_CAST<byte *>((GHIDRA_INT(local_a0) + 0x10));
|
|
if (0xf < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(local_a0) + 0x24))) {
|
|
labelText = *GHIDRA_CAST<byte **>(labelText);
|
|
}
|
|
local_ac = &g_manager->_stringTable;
|
|
if (*labelText == 0x23) {
|
|
isStringFound = 0;
|
|
local_80.y = (float)(labelText + 1);
|
|
(GHIDRA_CAST<StringTable *>((local_ac)))->StringTable::get_string(GHIDRA_CAST<byte *>("Default"),0,GHIDRA_CAST<byte *>(local_80.y),&isStringFound);
|
|
if (isStringFound == 0) {
|
|
isStringFound = 0;
|
|
labelText = StringTable::get_string
|
|
(local_ac,GHIDRA_CAST<byte *>("Default"),0,GHIDRA_CAST<byte *>(local_80.y),&isStringFound);
|
|
}
|
|
}
|
|
(GHIDRA_CAST<KColor *>((&textColor)))->KColor::SetFromARGB(0xffffffff);
|
|
FUN_007cf9a0(&linePos,extraout_ECX_10,"%s: %d",labelText,local_a8.y);
|
|
linePos.y = lineY + 8.0;
|
|
player = local_b4;
|
|
lineY = linePos.y;
|
|
}
|
|
uVar1 = uVar1 + 1;
|
|
} while (uVar1 < 0x10);
|
|
if (0xf < bitsText._capacity) {
|
|
uVar1 = bitsText._capacity + 1;
|
|
pvVar3 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)bitsText._buf)) + 0x0)));
|
|
if (0xfff < uVar1) {
|
|
pvVar3 = *(void **)((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(bitsText._buf)) + 0x0))) + -4);
|
|
uVar1 = bitsText._capacity + 0x24;
|
|
if (0x1f < ((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(bitsText._buf)) + 0x0))) - GHIDRA_INT(pvVar3)) - 4U) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar3,uVar1);
|
|
}
|
|
}
|
|
else {
|
|
local_80.x = 120.0;
|
|
local_80.y = 7.0;
|
|
render_quad_set_rect(bgQuad,&linePos,&local_80,&bgColor);
|
|
render_color_shader_pass(quad);
|
|
(GHIDRA_CAST<KColor *>((&textColor)))->KColor::SetFromARGB(0xffffffff);
|
|
FUN_007cf9a0(&linePos,extraout_ECX,"History",uVar1);
|
|
linePos.y = lineY + 3.0;
|
|
lineY = linePos.y;
|
|
(GHIDRA_CAST<KColor *>((&textColor)))->KColor::SetFromARGB(0xffffffff);
|
|
FUN_007cf9a0(&linePos,extraout_ECX_00,"_____________________");
|
|
puVar4 = (debugPlayer->_history)._historyItems._begin;
|
|
if (puVar4 != (debugPlayer->_history)._historyItems._end) {
|
|
do {
|
|
lineY = lineY + 8.0;
|
|
linePos.y = lineY;
|
|
if (*GHIDRA_CAST<char *>((puVar4 + 1)) == '\0') {
|
|
local_a0 = GHIDRA_CAST<Vector *>(FUN_007cfa90());
|
|
local_b8 = local_9c;
|
|
local_b4 = GHIDRA_CAST<Entity_Player *>(lineY);
|
|
local_a8.x = 300.0;
|
|
local_a8.y = 7.0;
|
|
render_quad_set_rect(bgQuad,&linePos,&local_a8,&bgColor);
|
|
render_color_shader_pass(quad_01);
|
|
uVar1 = puVar4[6];
|
|
if ((GHIDRA_INT(uVar1) < 0) || (0x1e < uVar1)) {
|
|
labelText = &s_empty;
|
|
}
|
|
else {
|
|
labelText = (&PTR_s_treasure_00b1f3d0)[uVar1];
|
|
}
|
|
uVar1 = puVar4[5];
|
|
if ((GHIDRA_INT(uVar1) < 0) || (0x1d < uVar1)) {
|
|
roomTypeName = &s_empty;
|
|
}
|
|
else {
|
|
roomTypeName = (&PTR_DAT_00b1fd50)[uVar1];
|
|
}
|
|
textColor._red = 1.0;
|
|
historyStageType = puVar4[4];
|
|
historyStage = puVar4[3];
|
|
historyTime = *puVar4;
|
|
historyPos = &local_b8;
|
|
}
|
|
else {
|
|
local_a0 = GHIDRA_CAST<Vector *>(FUN_007cfa90());
|
|
local_b0 = local_9c;
|
|
local_ac = GHIDRA_CAST<StringTable *>(lineY);
|
|
local_80.x = 300.0;
|
|
local_80.y = 7.0;
|
|
render_quad_set_rect(bgQuad,&linePos,&local_80,&bgColor);
|
|
render_color_shader_pass(quad_00);
|
|
uVar1 = puVar4[6];
|
|
if ((GHIDRA_INT(uVar1) < 0) || (0x1e < uVar1)) {
|
|
labelText = &s_empty;
|
|
}
|
|
else {
|
|
labelText = (&PTR_s_treasure_00b1f3d0)[uVar1];
|
|
}
|
|
uVar1 = puVar4[5];
|
|
if ((GHIDRA_INT(uVar1) < 0) || (0x1d < uVar1)) {
|
|
roomTypeName = &s_empty;
|
|
}
|
|
else {
|
|
roomTypeName = (&PTR_DAT_00b1fd50)[uVar1];
|
|
}
|
|
textColor._red = 0.0;
|
|
historyStageType = puVar4[4];
|
|
historyStage = puVar4[3];
|
|
historyTime = *puVar4;
|
|
historyPos = &local_b0;
|
|
}
|
|
textColor._unk = 0;
|
|
textColor._green = 1.0;
|
|
textColor._blue = 1.0;
|
|
textColor._alpha = 1.0;
|
|
FUN_007cf9a0(historyPos,&textColor,"%s: time: %d, stage: %d.%d, room type: %s, pool: %s",
|
|
local_a0,historyTime,historyStage,historyStageType,roomTypeName,labelText);
|
|
puVar4 = puVar4 + 7;
|
|
} while (puVar4 != (debugPlayer->_history)._historyItems._end);
|
|
}
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 007db330
|
|
int Game::damage_cooldown_scale(int ticks)
|
|
{
|
|
uint scaledTicks;
|
|
|
|
if (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) {
|
|
return ticks;
|
|
}
|
|
scaledTicks = 1;
|
|
if (0xf < ticks) {
|
|
scaledTicks = GHIDRA_UINT(ticks) >> 3;
|
|
}
|
|
return scaledTicks;
|
|
}
|
|
|
|
// 007db3b0
|
|
void Game::reset_players_for_greed(Entity_Player *player)
|
|
{
|
|
int *piVar1;
|
|
uint uVar2;
|
|
void *pvVar3;
|
|
void **ppvVar4;
|
|
uint i;
|
|
void *pvVar5;
|
|
EntityList_EL familiars;
|
|
void *local_2c;
|
|
void *local_28;
|
|
void *local_24;
|
|
void **local_20;
|
|
void *local_1c;
|
|
void *local_18;
|
|
void *local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
std_vector *greedResetCollectibles;
|
|
EntityPtr otherPlayer;
|
|
int savedDamageTaken;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b00565;
|
|
local_10 = ExceptionList;
|
|
uVar2 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
if (player->_exists == 0) {
|
|
return;
|
|
}
|
|
if (player->_valid == 0) {
|
|
return;
|
|
}
|
|
local_20 = (void **)player->_controllerIndex;
|
|
ExceptionList = &local_10;
|
|
EntityList::QuerySublist(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),&familiars,3,-1,-1,0,0);
|
|
local_8 = 0;
|
|
i = 0;
|
|
if (familiars._size != 0) {
|
|
pvVar3 = familiars._data;
|
|
do {
|
|
piVar1 = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(pvVar3) + i * 4));
|
|
if (((piVar1 != GHIDRA_CAST<int *>(0x0)) && (piVar1[10] == 3)) &&
|
|
(GHIDRA_CAST<Entity_Player *>(piVar1[0x104]) == player)) {
|
|
(**(code **)(*piVar1 + 0x28))(uVar2);
|
|
pvVar3 = familiars._data;
|
|
}
|
|
i = i + 1;
|
|
} while (i < GHIDRA_UINT(familiars._size));
|
|
}
|
|
local_2c = (void *)0x0;
|
|
local_14 = (void *)0x0;
|
|
local_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),1);
|
|
otherPlayer = player->_twinPlayer;
|
|
local_18 = (void *)0x0;
|
|
if ((otherPlayer != (EntityPtr)0x0) ||
|
|
(otherPlayer = (EntityPtr)player->_backupPlayer, otherPlayer != (EntityPtr)0x0)) {
|
|
local_18 = (void *)0x0;
|
|
ppvVar4 = (void **)(GHIDRA_INT(otherPlayer) + 0x20dc);
|
|
if (&local_2c != ppvVar4) {
|
|
local_14 = *(void **)(GHIDRA_CAST<char *>(otherPlayer) + 0x20e0);
|
|
local_18 = *(void **)(GHIDRA_CAST<char *>(otherPlayer) + 0x20e4);
|
|
local_2c = *ppvVar4;
|
|
*ppvVar4 = (void *)0x0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(otherPlayer) + 0x20e0)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(otherPlayer) + 0x20e4)) = 0;
|
|
}
|
|
}
|
|
local_24 = local_18;
|
|
local_1c = local_2c;
|
|
if (player->_playerType == 0x26) {
|
|
greedResetCollectibles = &player->_greedResetCollectibles;
|
|
player->_playerType = 0x1d;
|
|
if (GHIDRA_CAST<std_vector *>(&local_2c) != greedResetCollectibles) {
|
|
local_1c = greedResetCollectibles->_begin;
|
|
local_24 = (player->_greedResetCollectibles)._capacity;
|
|
pvVar3 = (player->_greedResetCollectibles)._end;
|
|
greedResetCollectibles->_begin = local_2c;
|
|
(player->_greedResetCollectibles)._end = local_14;
|
|
(player->_greedResetCollectibles)._capacity = local_18;
|
|
local_14 = pvVar3;
|
|
}
|
|
}
|
|
else if (player->_playerType == 0x27) {
|
|
player->_playerType = 0x25;
|
|
}
|
|
pvVar3 = local_24;
|
|
local_2c = local_1c;
|
|
local_28 = local_14;
|
|
(GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::release_weapons_and_effects(1);
|
|
savedDamageTaken = player->_totalDamageTaken;
|
|
(**(code **)(*GHIDRA_CAST<int *>(player) + 4))
|
|
(player->_type,player->_variant,player->_playerType,player->_initSeed);
|
|
(GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::SetControllerIndex(GHIDRA_INT(local_20),0);
|
|
ppvVar4 = local_20;
|
|
player->_totalDamageTaken = savedDamageTaken;
|
|
if (player->_twinPlayer != (EntityPtr)0x0) {
|
|
(GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(player->_twinPlayer))))->Entity_Player::SetControllerIndex(GHIDRA_INT(local_20),0);
|
|
}
|
|
if (player->_backupPlayer != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
(GHIDRA_CAST<Entity_Player *>((player->_backupPlayer)))->Entity_Player::SetControllerIndex(GHIDRA_INT(ppvVar4),0);
|
|
}
|
|
(GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::ResetPlayer();
|
|
pvVar5 = local_1c;
|
|
if (local_1c == local_14) goto LAB_007db61a;
|
|
otherPlayer = player->_twinPlayer;
|
|
if (otherPlayer == (EntityPtr)0x0) {
|
|
otherPlayer = (EntityPtr)player->_backupPlayer;
|
|
if (otherPlayer == (EntityPtr)0x0) goto LAB_007db61a;
|
|
local_20 = (void **)(GHIDRA_INT(otherPlayer) + 0x20dc);
|
|
if (&local_2c != local_20) {
|
|
local_2c = *local_20;
|
|
*local_20 = local_1c;
|
|
local_28 = *(void **)(GHIDRA_CAST<char *>(otherPlayer) + 0x20e0);
|
|
local_24 = *(void **)(GHIDRA_CAST<char *>(otherPlayer) + 0x20e4);
|
|
*(void **)(GHIDRA_CAST<char *>(otherPlayer) + 0x20e0) = local_14;
|
|
*(void **)(GHIDRA_CAST<char *>(otherPlayer) + 0x20e4) = pvVar3;
|
|
otherPlayer = (EntityPtr)player->_backupPlayer;
|
|
goto LAB_007db60d;
|
|
}
|
|
}
|
|
else {
|
|
local_20 = (void **)(GHIDRA_INT(otherPlayer) + 0x20dc);
|
|
if (&local_2c != local_20) {
|
|
local_2c = *local_20;
|
|
*local_20 = local_1c;
|
|
local_28 = *(void **)(GHIDRA_CAST<char *>(otherPlayer) + 0x20e0);
|
|
local_24 = *(void **)(GHIDRA_CAST<char *>(otherPlayer) + 0x20e4);
|
|
*(void **)(GHIDRA_CAST<char *>(otherPlayer) + 0x20e0) = local_14;
|
|
*(void **)(GHIDRA_CAST<char *>(otherPlayer) + 0x20e4) = pvVar3;
|
|
otherPlayer = player->_twinPlayer;
|
|
LAB_007db60d:
|
|
pvVar3 = local_24;
|
|
pvVar5 = local_2c;
|
|
}
|
|
}
|
|
(GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(otherPlayer))))->Entity_Player::ResetPlayer();
|
|
LAB_007db61a:
|
|
player->_visible = 0;
|
|
if (player->_twinPlayer != (EntityPtr)0x0) {
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(player->_twinPlayer) + 0x171)) = 0;
|
|
}
|
|
local_8 = local_8 & 0xffffff00;
|
|
if (pvVar5 != (void *)0x0) {
|
|
uVar2 = GHIDRA_INT(pvVar3) - GHIDRA_INT(pvVar5) & 0xfffffffc;
|
|
pvVar3 = pvVar5;
|
|
if (0xfff < uVar2) {
|
|
pvVar3 = *(void **)(GHIDRA_CAST<char *>(pvVar5) + -4);
|
|
uVar2 = uVar2 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(pvVar5) + (-4 - GHIDRA_INT(pvVar3))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar3,uVar2);
|
|
}
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(familiars)) + 0x0))) == '\0') {
|
|
local_8 = 2;
|
|
tracked_alloc(1,familiars._data,0);
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 007e92c0
|
|
int Game::GetDonationModAngel()
|
|
{
|
|
return this->_donationModAngel;
|
|
}
|
|
|
|
// 007e92d0
|
|
int Game::GetLastLevelWithDamage()
|
|
{
|
|
return this->_lastLevelWithDamage;
|
|
}
|
|
|
|
// 007e9310
|
|
int Game::BossRushParTime()
|
|
{
|
|
return this->_bossRushParTime;
|
|
}
|
|
|
|
// 007e9320
|
|
int Game::BlueWombParTime()
|
|
{
|
|
return this->_blueWombParTime;
|
|
}
|
|
|
|
// 007e9330
|
|
void Game::SetLastDevilRoomStage(int stage)
|
|
{
|
|
int clampedStage;
|
|
|
|
if (stage < 1) {
|
|
stage = 0;
|
|
}
|
|
clampedStage = 0xd;
|
|
if (stage < 0xd) {
|
|
clampedStage = stage;
|
|
}
|
|
this->_lastDevilRoomStage = clampedStage;
|
|
return;
|
|
}
|
|
|
|
// 007e9360
|
|
int Game::GetLastDevilRoomStage()
|
|
{
|
|
return this->_lastDevilRoomStage;
|
|
}
|
|
|
|
// 007e9370
|
|
void Game::AddTreasureRoomsVisited()
|
|
{
|
|
this->_treasureRoomsVisited = this->_treasureRoomsVisited + 1;
|
|
return;
|
|
}
|
|
|
|
// 007e9380
|
|
int Game::GetStagesWithoutDamage()
|
|
{
|
|
return this->_stagesWithoutDamage;
|
|
}
|
|
|
|
// 00806c20
|
|
void Game::Render(Entity *entity, Vector *renderOffset)
|
|
{
|
|
Entity_Player *pEVar1;
|
|
char cVar2;
|
|
byte bVar3;
|
|
float *pfVar4;
|
|
Vector *pVVar5;
|
|
char *local_EAX_515;
|
|
byte *pbVar6;
|
|
LayerState *layer;
|
|
int frameIndex;
|
|
ItemConfig_Item *costumeItem;
|
|
Font *pFVar7;
|
|
BitSet128 *maskedTearFlags;
|
|
Seeds *seeds;
|
|
ColorMod *color_00;
|
|
Color *pCVar8;
|
|
Sprite *sprite;
|
|
undefined4 variant;
|
|
uint uVar9;
|
|
int *laserEndPoint;
|
|
AnimationState *pAVar10;
|
|
void *pvVar11;
|
|
ColorMod *color_01;
|
|
Vector *pVVar12;
|
|
Vector *pVVar13;
|
|
ColorMod *color_02;
|
|
Entity *pEVar14;
|
|
KColor *pKVar15;
|
|
ColorMod *color_03;
|
|
ColorMod *color_04;
|
|
ColorMod *color_05;
|
|
ColorMod *color_06;
|
|
GridEntity *local_EAX_18866;
|
|
std_string *layerName;
|
|
ColorMod *color_07;
|
|
uint uVar16;
|
|
ColorMod *color;
|
|
Vector *pVVar17;
|
|
Room *roomAlias;
|
|
Room *pRVar18;
|
|
ANM2 *pAVar19;
|
|
int iVar20;
|
|
ANM2 *lightSprite;
|
|
float10 fVar21;
|
|
float fVar22;
|
|
float fVar23;
|
|
undefined1 entityColor [12];
|
|
float fStack_26c;
|
|
Vector *bottomrightclamp;
|
|
Vector flameQuad;
|
|
Vector flameDelta1;
|
|
Vector flameDelta2 [12];
|
|
KColor layer0Color;
|
|
Vector local_1b8;
|
|
Vector local_1b0;
|
|
KColor local_1a8;
|
|
Vector local_194;
|
|
byte isFlameLayer;
|
|
Vector local_188;
|
|
Vector local_180;
|
|
undefined1 local_178 [8];
|
|
Vector local_170;
|
|
undefined1 tearFlags [8];
|
|
Vector local_160;
|
|
float local_154;
|
|
Vector local_150;
|
|
undefined1 local_148 [8];
|
|
void *local_140;
|
|
Vector local_13c;
|
|
ANM2 *local_130;
|
|
ANM2 *local_12c;
|
|
Vector local_128;
|
|
Vector local_120;
|
|
Vector renderOffsetLocal;
|
|
Vector local_110;
|
|
ANM2 *local_108;
|
|
Entity_Player *lightEntity;
|
|
Vector local_100;
|
|
Room *room;
|
|
Color lightColor2;
|
|
undefined1 local_c8 [28];
|
|
void *local_ac;
|
|
ANM2 *local_a8;
|
|
void *local_a4;
|
|
float local_a0;
|
|
Color lightColor;
|
|
ColorMod tmpColor;
|
|
RNG flickerRng;
|
|
float local_24;
|
|
undefined1 *puStack_20;
|
|
void *local_1c;
|
|
undefined1 *puStack_18;
|
|
float local_14;
|
|
int layerFramesBase;
|
|
EntityPtr temp_5ff20d4b15;
|
|
|
|
puStack_20 = GHIDRA_CAST<undefined1 *>((GHIDRA_INT(register0x00000010) + -4));
|
|
puStack_18 = &LAB_00b014f8;
|
|
local_1c = ExceptionList;
|
|
local_24 = (float)(__security_cookie ^ GHIDRA_UINT((&tmpColor + 2)));
|
|
ExceptionList = &local_1c;
|
|
flickerRng._seed = g_game->_frameCount + entity->_initSeed;
|
|
lightEntity = GHIDRA_CAST<Entity_Player *>(entity);
|
|
if ((void *)flickerRng._seed == (void *)0x0) {
|
|
flickerRng._seed = 1;
|
|
}
|
|
flickerRng._shift1 = 5;
|
|
flickerRng._shift2 = 0x1b;
|
|
flickerRng._shift3 = 0x19;
|
|
local_14 = 0.0;
|
|
renderOffsetLocal.x = renderOffset->x;
|
|
renderOffsetLocal.y = renderOffset->y;
|
|
DAT_00c7977e = 1;
|
|
room = GHIDRA_CAST<Room *>(this);
|
|
pfVar4 = GHIDRA_CAST<float *>(FUN_006b7cc0());
|
|
renderOffsetLocal.x = renderOffsetLocal.x + *pfVar4;
|
|
renderOffsetLocal.y = renderOffsetLocal.y + pfVar4[1];
|
|
if (entity->_visible != 0) {
|
|
uVar16 = (entity->_sprite)._bitflags;
|
|
if ((uVar16 >> 0xb & 1) != 0) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_178)) + 0x0))) = (entity->_pos).x + (entity->_posOffset).x;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_178)) + 0x4))) = (entity->_pos).y + (entity->_posOffset).y;
|
|
pVVar5 = Isaac::GetRenderPosition(&local_13c,GHIDRA_CAST<Vector *>(local_178),1);
|
|
local_160.y = (float)(renderOffsetLocal.x + pVVar5->x);
|
|
local_130 = &entity->_sprite;
|
|
local_180.x = (float)&(entity->_sprite)._overlayAnimState;
|
|
local_180.y = (float)&(entity->_sprite)._animState;
|
|
local_100.y = (float)(renderOffsetLocal.y + pVVar5->y);
|
|
if (this->_roomList[0x99].SavedGridEntities._begin != (void *)0x0) {
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(&this->_roomList[0x99].BossDeathSeed))))->AnimationState::SetFrameFloat(0.0);
|
|
}
|
|
lightSprite = local_130;
|
|
local_150.y = 0.0;
|
|
do {
|
|
local_108 = *GHIDRA_CAST<ANM2 **>((*GHIDRA_CAST<int *>((local_178 + GHIDRA_INT(local_150.y) * 4 + -8)) + 4));
|
|
if ((local_108 != GHIDRA_CAST<ANM2 *>(0x0)) &&
|
|
(local_12c = GHIDRA_CAST<ANM2 *>(0x0), *GHIDRA_CAST<int *>((GHIDRA_INT((local_108->_animDefaultName)._buf) + 0xc)) != 0))
|
|
{
|
|
local_154 = 0.0;
|
|
do {
|
|
local_130 = *GHIDRA_CAST<ANM2 **>((*GHIDRA_CAST<int *>((GHIDRA_INT((local_108->_animDefaultName)._buf) + 8)) +
|
|
GHIDRA_INT(local_154)));
|
|
local_EAX_515 = GHIDRA_CAST<char *>(FUN_0040b4d0());
|
|
pbVar6 = (GHIDRA_CAST<std::string *>((local_EAX_515)))->std::string::c_str();
|
|
if ((*pbVar6 == 0x2a) && ((lightSprite->_animState)._animData != (void *)0x0)) {
|
|
local_130 = AnimationState::GetNullFrameById
|
|
(GHIDRA_CAST<AnimationState *>(local_180.y),GHIDRA_INT(local_130));
|
|
if ((local_130 != GHIDRA_CAST<ANM2 *>(0x0)) &&
|
|
(((local_130->_filename)._buf[0xc] != '\0' &&
|
|
(0.0 < *GHIDRA_CAST<float *>(((local_130->_animDefaultName)._buf + 0xc)))))) {
|
|
local_120.y = ((lightSprite->_offset).y +
|
|
*GHIDRA_CAST<float *>(((local_130->_filename)._buf + 4))) * (lightSprite->_scale).y
|
|
;
|
|
local_120.x = ((lightSprite->_offset).x + *GHIDRA_CAST<float *>((local_130->_filename)._buf)) *
|
|
(lightSprite->_scale).x;
|
|
(GHIDRA_CAST<Vector *>((&local_120)))->Vector::Rotated(&local_170,lightSprite->_rotation);
|
|
if (lightSprite->_flipX != 0) {
|
|
local_170.x = local_170.x * -1.0;
|
|
}
|
|
if (lightSprite->_flipY != 0) {
|
|
local_170.y = local_170.y * -1.0;
|
|
}
|
|
(GHIDRA_CAST<KColor *>((GHIDRA_CAST<KColor *>((local_c8 + 0x18)))))->KColor::SetFromARGB(0xffffffff);
|
|
lightColor._tint[0] = (lightSprite->_color)._tint[0];
|
|
lightColor._tint[1] = (lightSprite->_color)._tint[1];
|
|
lightColor._tint[2] = (lightSprite->_color)._tint[2];
|
|
lightColor._tint[3] = (lightSprite->_color)._tint[3];
|
|
pKVar15 = GHIDRA_CAST<KColor *>((local_c8 + 0x18));
|
|
lightColor._offset[2] = (lightSprite->_color)._offset[2];
|
|
lightColor._colorize[0] = (lightSprite->_color)._colorize[0];
|
|
lightColor._colorize[1] = (lightSprite->_color)._colorize[1];
|
|
lightColor._colorize[2] = (lightSprite->_color)._colorize[2];
|
|
lightColor._colorize[3] = (lightSprite->_color)._colorize[3];
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(lightColor._offset)) + 0x0))) = *GHIDRA_CAST<undefined8 *>((lightSprite->_color)._offset);
|
|
(GHIDRA_CAST<Color *>((&lightColor)))->Color::__mul(GHIDRA_CAST<ColorMod *>(&local_130->_animDefaultName));
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&tmpColor))))->Color::operator_assign(GHIDRA_CAST<ColorMod *>(&lightColor));
|
|
Color::apply_to_kcolor(&local_1a8,&tmpColor,pKVar15);
|
|
local_1b0.y = local_1a8._alpha;
|
|
local_1b8.y = local_1a8._blue;
|
|
local_194.y = local_1a8._green;
|
|
local_188.y = local_1a8._red;
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&tmpColor))))->Color::Reset();
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&tmpColor))))->Color::SetTint(local_188.y,local_194.y,local_1b8.y,local_1b0.y);
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>((this->_roomList[0x9a]._doors + 2)))))->Color::operator_assign(&tmpColor);
|
|
fVar23 = (float)(local_130->_filename)._size;
|
|
fVar22 = (lightSprite->_scale).x;
|
|
(room->_lightSprite)._scale.y =
|
|
(lightSprite->_scale).y * (float)(local_130->_filename)._capacity;
|
|
(room->_lightSprite)._scale.x = fVar23 * fVar22;
|
|
local_110.x = local_160.y + local_170.x;
|
|
(room->_lightSprite)._rotation =
|
|
lightSprite->_rotation + *GHIDRA_CAST<float *>(&(local_130->_animState)._isPlaying);
|
|
local_110.y = local_100.y + local_170.y;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((this->_roomList[0x99]._doors + 6)))))->ANM2::Render(&local_110,&g_vectorZero,
|
|
&g_vectorZero);
|
|
this = GHIDRA_CAST<Game *>(room);
|
|
}
|
|
}
|
|
local_12c = GHIDRA_CAST<ANM2 *>((GHIDRA_INT((local_12c->_filename)._buf) + 1));
|
|
local_154 = (float)(GHIDRA_INT(local_154) + 0x10);
|
|
} while (local_12c < *GHIDRA_CAST<ANM2 **>((GHIDRA_INT((local_108->_animDefaultName)._buf) + 0xc)));
|
|
}
|
|
local_150.y = (float)(GHIDRA_INT((GHIDRA_CAST<std_string *>(local_150.y))->_buf) + 1);
|
|
} while (GHIDRA_UINT(local_150.y) < GHIDRA_CAST<ANM2 *>(0x2));
|
|
this->_roomList[0x9a]._doors[1] = 0;
|
|
uVar16 = (lightEntity->_sprite)._bitflags;
|
|
entity = GHIDRA_CAST<Entity *>(lightEntity);
|
|
}
|
|
if ((uVar16 >> 10 & 1) != 0) {
|
|
local_120.x = ((GHIDRA_CAST<Entity_Player *>(entity))->_pos).x + ((GHIDRA_CAST<Entity_Player *>(entity))->_posOffset).x;
|
|
local_120.y = ((GHIDRA_CAST<Entity_Player *>(entity))->_pos).y + ((GHIDRA_CAST<Entity_Player *>(entity))->_posOffset).y;
|
|
pVVar5 = Isaac::GetRenderPosition(&local_194,&local_120,1);
|
|
lightSprite = &(GHIDRA_CAST<Entity_Player *>(entity))->_sprite;
|
|
local_12c = lightSprite;
|
|
local_188.x = renderOffsetLocal.x + pVVar5->x;
|
|
local_188.y = renderOffsetLocal.y + pVVar5->y;
|
|
local_180.x = (float)&((GHIDRA_CAST<Entity_Player *>(entity))->_sprite)._overlayAnimState;
|
|
local_180.y = (float)&((GHIDRA_CAST<Entity_Player *>(entity))->_sprite)._animState;
|
|
local_154 = 0.0;
|
|
do {
|
|
pvVar11 = *(void **)(*GHIDRA_CAST<int *>((local_178 + GHIDRA_INT(local_154) * 4 + -8)) + 4);
|
|
local_160.y = (float)pvVar11;
|
|
if (pvVar11 != (void *)0x0) {
|
|
local_150.y = 0.0;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 0x1c)) != 0) {
|
|
iVar20 = 0;
|
|
do {
|
|
local_100.y = *GHIDRA_CAST<float *>((iVar20 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 0x18))));
|
|
layer = (GHIDRA_CAST<ANM2 *>((lightSprite)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(local_100.y));
|
|
if ((layer->_bitflags & 4) != 0) {
|
|
layerFramesBase = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 0x18));
|
|
frameIndex = AnimationState::GetLayerFrameIdx
|
|
(*GHIDRA_CAST<AnimationState **>((local_178 + GHIDRA_INT(local_154) * 4 + -8)),
|
|
GHIDRA_INT(local_100.y));
|
|
AnimationLayer::RenderFrame
|
|
(GHIDRA_CAST<AnimationLayer *>((layerFramesBase + iVar20)),&local_188,frameIndex,
|
|
&g_vectorZero,&g_vectorZero,local_12c);
|
|
pvVar11 = (void *)local_160.y;
|
|
}
|
|
iVar20 = iVar20 + 0x10;
|
|
local_150.y = (float)(GHIDRA_INT((GHIDRA_CAST<std_string *>(local_150.y))->_buf) + 1);
|
|
lightSprite = local_12c;
|
|
} while (GHIDRA_UINT(local_150.y) < *GHIDRA_CAST<ANM2 **>((GHIDRA_CAST<char *>(pvVar11) + 0x1c)));
|
|
}
|
|
}
|
|
local_154 = (float)(GHIDRA_INT(local_154) + 1);
|
|
} while (GHIDRA_UINT(local_154) < 2);
|
|
this = GHIDRA_CAST<Game *>(room);
|
|
entity = GHIDRA_CAST<Entity *>(lightEntity);
|
|
}
|
|
}
|
|
iVar20 = (GHIDRA_CAST<Entity_Player *>(entity))->_type;
|
|
lightSprite = GHIDRA_CAST<ANM2 *>(0x3f800000);
|
|
if (iVar20 < 0x1a) {
|
|
if (iVar20 == 0x19) {
|
|
if (((GHIDRA_CAST<Entity_Player *>(entity))->_variant == 3) && (this->_roomList[0x28].Flags == 0x2e)) {
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&tmpColor))))->Color::Reset();
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&tmpColor))))->Color::SetTint(1.0,0.4,0.0,1.0);
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>((this->_roomList[0x9a]._doors + 2)))))->Color::operator_assign(&tmpColor);
|
|
fVar23 = g_vectorOne.x * 0.8;
|
|
this->_roomList[0x9a]._doors[0] = GHIDRA_INT((g_vectorOne.y * 0.8));
|
|
this->_roomList[0x9a].AllowedDoors = GHIDRA_INT(fVar23);
|
|
local_110.x = ((GHIDRA_CAST<Entity_Player *>(entity))->_pos).x + 0.0;
|
|
local_110.y = ((GHIDRA_CAST<Entity_Player *>(entity))->_pos).y - 16.0;
|
|
pVVar5 = Isaac::GetRenderPosition(&local_13c,&local_110,1);
|
|
local_100.y = renderOffsetLocal.x + pVVar5->x;
|
|
local_160.y = renderOffsetLocal.y + pVVar5->y;
|
|
uVar16 = (GHIDRA_CAST<RNG *>((&flickerRng)))->RNG::Next();
|
|
pVVar5 = RandomVector(&local_128,uVar16);
|
|
(GHIDRA_CAST<RNG *>((&flickerRng)))->RNG::Next();
|
|
fVar23 = (float)((double)flickerRng._seed +
|
|
__uint_to_double_fixup[-(flickerRng._seed >> 0x1f)]) * 2.3283062e-10;
|
|
fVar23 = fVar23 + fVar23;
|
|
local_120.y = fVar23 * pVVar5->y + local_160.y;
|
|
local_120.x = fVar23 * pVVar5->x + local_100.y;
|
|
LAB_00809a2f:
|
|
pRVar18 = room;
|
|
(GHIDRA_CAST<ANM2 *>((&room->_lightSprite)))->ANM2::Render(&local_120,&g_vectorZero,&g_vectorZero);
|
|
goto LAB_00807b3d;
|
|
}
|
|
goto switchD_00809dea_caseD_2;
|
|
}
|
|
switch(iVar20) {
|
|
case 1:
|
|
if ((GHIDRA_CAST<Entity_Player *>(entity))->_exists != 0) {
|
|
local_110.x = ((GHIDRA_CAST<Entity_Player *>(entity))->_pos).x +
|
|
((GHIDRA_CAST<Entity_Player *>(entity))->_posOffset).x;
|
|
local_110.y = ((GHIDRA_CAST<Entity_Player *>(entity))->_pos).y +
|
|
((GHIDRA_CAST<Entity_Player *>(entity))->_posOffset).y;
|
|
pVVar5 = Isaac::GetRenderPosition(&local_13c,&local_110,1);
|
|
local_170.x = renderOffsetLocal.x + pVVar5->x;
|
|
local_170.y = renderOffsetLocal.y + pVVar5->y;
|
|
local_108 = GHIDRA_CAST<ANM2 *>(0x3f800000);
|
|
if ((((GHIDRA_CAST<Entity_Player *>(entity))->_temporaryeffects)._disabled == 0) &&
|
|
(pvVar11 = TemporaryEffects::GetNullEffect
|
|
(&(GHIDRA_CAST<Entity_Player *>(entity))->_temporaryeffects,0x4a),
|
|
pvVar11 != (void *)0x0)) {
|
|
iVar20 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar11) + 4));
|
|
}
|
|
else {
|
|
iVar20 = 0;
|
|
}
|
|
local_150.y = (float)iVar20;
|
|
if (5.0 <= local_150.y) {
|
|
local_150.y = 5.0;
|
|
}
|
|
bVar3 = (GHIDRA_CAST<TemporaryEffects *>((&(GHIDRA_CAST<Entity_Player *>(entity))->_temporaryeffects)))->TemporaryEffects::HasNullEffect(0x4a);
|
|
if (bVar3 != 0) {
|
|
(GHIDRA_CAST<BlendMode *>((local_148)))->BlendMode::SetMode(2,0);
|
|
lightSprite = GHIDRA_CAST<ANM2 *>((this->_roomList[0x99]._doors + 6));
|
|
layer = (GHIDRA_CAST<ANM2 *>((lightSprite)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x0));
|
|
layer->_blendMode[0] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_148)) + 0x0)));
|
|
layer->_blendMode[1] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_148)) + 0x4)));
|
|
layer->_blendMode[2] = GHIDRA_INT(local_140);
|
|
layer->_blendMode[3] = GHIDRA_INT(local_13c.x);
|
|
layer->_blendMode[4] = GHIDRA_INT(local_13c.y);
|
|
(GHIDRA_CAST<Color *>((&lightColor)))->Color::Reset();
|
|
(GHIDRA_CAST<Color *>((&lightColor)))->Color::SetTint(0.4,0.6,1.0,local_150.y * 0.12 + 0.3);
|
|
lightColor._offset[0] = 0.0;
|
|
lightColor._offset[1] = 0.0;
|
|
lightColor._offset[2] = 0.0;
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&(room->_lightSprite)._color))))->Color::operator_assign(GHIDRA_CAST<ColorMod *>(&lightColor));
|
|
fVar23 = (local_150.y + 2.0) * g_vectorOne.x;
|
|
(room->_lightSprite)._scale.y = (local_150.y + 2.0) * g_vectorOne.y;
|
|
(room->_lightSprite)._scale.x = fVar23;
|
|
(GHIDRA_CAST<ANM2 *>((lightSprite)))->ANM2::Render(&local_170,&g_vectorZero,&g_vectorZero);
|
|
(GHIDRA_CAST<BlendMode *>((local_148)))->BlendMode::SetMode(1,0);
|
|
layer = (GHIDRA_CAST<ANM2 *>((lightSprite)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x0));
|
|
layer->_blendMode[0] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_148)) + 0x0)));
|
|
layer->_blendMode[1] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_148)) + 0x4)));
|
|
layer->_blendMode[2] = GHIDRA_INT(local_140);
|
|
layer->_blendMode[3] = GHIDRA_INT(local_13c.x);
|
|
layer->_blendMode[4] = GHIDRA_INT(local_13c.y);
|
|
}
|
|
bVar3 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::IsMausoleumHeartStage();
|
|
if (bVar3 != 0) {
|
|
local_108 = GHIDRA_CAST<ANM2 *>(0x3f266666);
|
|
}
|
|
bVar3 = (GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(entity))))->Entity_Player::IsHologram();
|
|
if (bVar3 != 0) {
|
|
local_108 = GHIDRA_CAST<ANM2 *>(((float)local_108 * 0.3));
|
|
}
|
|
fVar23 = 0.0;
|
|
costumeItem = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(0x100);
|
|
bVar3 = Entity_Player::IsItemCostumeVisible(GHIDRA_CAST<Entity_Player *>(entity),costumeItem,GHIDRA_INT(fVar23))
|
|
;
|
|
if (bVar3 == 0) {
|
|
fVar23 = -NAN;
|
|
costumeItem = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(0x101);
|
|
bVar3 = Entity_Player::IsItemCostumeVisible
|
|
(GHIDRA_CAST<Entity_Player *>(entity),costumeItem,GHIDRA_INT(fVar23));
|
|
if ((bVar3 != 0) ||
|
|
(bVar3 = (GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(entity))))->Entity_Player::IsNullItemCostumeVisible(0x38,0),
|
|
bVar3 != 0)) goto LAB_008077c8;
|
|
fVar23 = -NAN;
|
|
costumeItem = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(3);
|
|
bVar3 = Entity_Player::IsItemCostumeVisible
|
|
(GHIDRA_CAST<Entity_Player *>(entity),costumeItem,GHIDRA_INT(fVar23));
|
|
if (bVar3 != 0) {
|
|
LAB_00807700:
|
|
roomAlias = room;
|
|
if ((GHIDRA_CAST<Entity_Player *>(entity))->_playerType == 0xc) {
|
|
(GHIDRA_CAST<Color *>((&lightColor)))->Color::Reset();
|
|
(GHIDRA_CAST<Color *>((&lightColor)))->Color::SetTint(1.0,0.0,0.03,1.0);
|
|
color = GHIDRA_CAST<ColorMod *>(&lightColor);
|
|
lightColor._offset[0] = 0.0;
|
|
lightColor._offset[1] = 0.0;
|
|
lightColor._offset[2] = 0.0;
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_c8))))->Color::Reset();
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_c8))))->Color::SetTint(0.9,0.3,1.0,1.0);
|
|
local_a8 = GHIDRA_CAST<ANM2 *>(0x0);
|
|
color = GHIDRA_CAST<ColorMod *>(local_c8);
|
|
local_a4 = (void *)0x0;
|
|
local_a0 = 0.0;
|
|
}
|
|
goto LAB_0080787f;
|
|
}
|
|
fVar23 = -NAN;
|
|
costumeItem = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(0xc0);
|
|
bVar3 = Entity_Player::IsItemCostumeVisible
|
|
(GHIDRA_CAST<Entity_Player *>(entity),costumeItem,GHIDRA_INT(fVar23));
|
|
if (bVar3 != 0) goto LAB_00807700;
|
|
fVar23 = -NAN;
|
|
costumeItem = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(0x23c);
|
|
bVar3 = Entity_Player::IsItemCostumeVisible
|
|
(GHIDRA_CAST<Entity_Player *>(entity),costumeItem,GHIDRA_INT(fVar23));
|
|
if (bVar3 != 0) goto LAB_00807700;
|
|
(GHIDRA_CAST<Color *>((&lightColor)))->Color::Reset();
|
|
(GHIDRA_CAST<Color *>((&lightColor)))->Color::SetTint(1.0,1.0,1.0,1.0);
|
|
roomAlias = room;
|
|
lightColor._offset[0] = 0.0;
|
|
lightColor._offset[1] = 0.0;
|
|
lightColor._offset[2] = 0.0;
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&(room->_lightSprite)._color))))->Color::operator_assign(GHIDRA_CAST<ColorMod *>(&lightColor));
|
|
fVar23 = -NAN;
|
|
costumeItem = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(0x5b);
|
|
bVar3 = Entity_Player::IsItemCostumeVisible
|
|
(GHIDRA_CAST<Entity_Player *>(entity),costumeItem,GHIDRA_INT(fVar23));
|
|
if (bVar3 != 0) {
|
|
fVar22 = g_vectorOne.x * 1.75;
|
|
fVar23 = g_vectorOne.y * 1.75;
|
|
goto LAB_008078ab;
|
|
}
|
|
bVar3 = (GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(entity))))->Entity_Player::HasCollectible(0x22e,0);
|
|
if (bVar3 != 0) goto LAB_0080788b;
|
|
(roomAlias->_lightSprite)._scale.x = g_vectorOne.x;
|
|
(roomAlias->_lightSprite)._scale.y = g_vectorOne.y;
|
|
}
|
|
else {
|
|
LAB_008077c8:
|
|
roomAlias = room;
|
|
if ((GHIDRA_CAST<Entity_Player *>(entity))->_playerType == 0xc) {
|
|
(GHIDRA_CAST<Color *>((&lightColor2)))->Color::Reset();
|
|
(GHIDRA_CAST<Color *>((&lightColor2)))->Color::SetTint(1.0,0.0,0.03,1.0);
|
|
lightColor2._offset[0] = 0.0;
|
|
color = GHIDRA_CAST<ColorMod *>(&lightColor2);
|
|
lightColor2._offset[1] = 0.0;
|
|
lightColor2._offset[2] = 0.0;
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&tmpColor))))->Color::Reset();
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&tmpColor))))->Color::SetTint(1.0,0.9,0.8,1.0);
|
|
color = &tmpColor;
|
|
tmpColor._offset[0] = 0.0;
|
|
tmpColor._offset[1] = 0.0;
|
|
tmpColor._offset[2] = 0.0;
|
|
}
|
|
LAB_0080787f:
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&(roomAlias->_lightSprite)._color))))->Color::operator_assign(color);
|
|
LAB_0080788b:
|
|
fVar22 = g_vectorOne.x * 1.5;
|
|
fVar23 = g_vectorOne.y * 1.5;
|
|
LAB_008078ab:
|
|
(roomAlias->_lightSprite)._scale.y = fVar23;
|
|
(roomAlias->_lightSprite)._scale.x = fVar22;
|
|
}
|
|
local_100.y = (float)&roomAlias->_lightSprite;
|
|
(roomAlias->_lightSprite)._color._tint[3] =
|
|
(float)local_108 * (roomAlias->_lightSprite)._color._tint[3];
|
|
if ((roomAlias->_lightSprite)._animState._animData != (void *)0x0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(roomAlias->_lightSprite)._animState)))->AnimationState::SetFrameFloat(1.0);
|
|
}
|
|
uVar16 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurses();
|
|
if ((uVar16 & 1) == 0) {
|
|
fVar23 = g_game->_darknessStrength * g_game->_darknessModifier;
|
|
}
|
|
else {
|
|
fVar23 = 1.0;
|
|
}
|
|
fVar22 = fVar23 * 0.5 + 1.0;
|
|
fVar23 = fVar22 * g_vectorOne.x;
|
|
(roomAlias->_lightSprite)._scale.y = fVar22 * g_vectorOne.y;
|
|
(roomAlias->_lightSprite)._scale.x = fVar23;
|
|
(GHIDRA_CAST<ANM2 *>((&roomAlias->_lightSprite)))->ANM2::Render(&local_170,&g_vectorZero,&g_vectorZero);
|
|
if ((roomAlias->_lightSprite)._animState._animData != (void *)0x0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(roomAlias->_lightSprite)._animState)))->AnimationState::SetFrameFloat(0.0);
|
|
}
|
|
bVar3 = (GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(entity))))->Entity_Player::HasCollectible(0x1a9,0);
|
|
if (bVar3 != 0) {
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((roomAlias)) + 0x6ff8)))) = (GHIDRA_CAST<Entity_Player *>(entity))->_bodyAngle - 90.0;
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&tmpColor))))->Color::Reset();
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((roomAlias)) + 0x6ffc)))))))->Color::operator_assign(&tmpColor);
|
|
(GHIDRA_CAST<BlendMode *>((local_148)))->BlendMode::SetMode(1,0);
|
|
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((roomAlias)) + 0x6f54)))))))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x0));
|
|
layer->_blendMode[0] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_148)) + 0x0)));
|
|
layer->_blendMode[1] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_148)) + 0x4)));
|
|
layer->_blendMode[2] = GHIDRA_INT(local_140);
|
|
layer->_blendMode[3] = GHIDRA_INT(local_13c.x);
|
|
layer->_blendMode[4] = GHIDRA_INT(local_13c.y);
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((roomAlias)) + 0x6f54)))))))->ANM2::Render(&local_170,&g_vectorZero,&g_vectorZero);
|
|
roomAlias = room;
|
|
}
|
|
uVar16 = GetStageID(g_game,0);
|
|
if ((uVar16 == 0xd) && (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(roomAlias->_descriptor) + 0x10)) + 8)) == 5)) {
|
|
uVar16 = (roomAlias->_entityList)._updateEL._size;
|
|
uVar9 = 0;
|
|
fVar23 = 0.1;
|
|
if (uVar16 != 0) {
|
|
do {
|
|
iVar20 = *GHIDRA_CAST<int *>((GHIDRA_INT((roomAlias->_entityList)._updateEL._data) + uVar9 * 4));
|
|
if ((*GHIDRA_CAST<int *>((iVar20 + 0x28)) == 0x197) && (*GHIDRA_CAST<int *>((iVar20 + 0x2c)) == 0)) {
|
|
fVar23 = 1.0 - *GHIDRA_CAST<float *>((iVar20 + 0x380)) / *GHIDRA_CAST<float *>((iVar20 + 900));
|
|
break;
|
|
}
|
|
uVar9 = uVar9 + 1;
|
|
} while (uVar9 < uVar16);
|
|
}
|
|
fVar23 = sin((float)g_game->_frameCount * (fVar23 * 0.18 + 0.02));
|
|
pVVar5 = &local_170;
|
|
pVVar13 = &g_vectorZero;
|
|
pVVar17 = &g_vectorZero;
|
|
fVar22 = (fVar23 + 3.0) * g_vectorOne.y;
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_INT(local_100.y) + 0x9c)))->x = (fVar23 + 3.0) * g_vectorOne.x;
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_INT(local_100.y) + 0x9c)))->y = fVar22;
|
|
lightSprite = GHIDRA_CAST<ANM2 *>(local_100.y);
|
|
goto LAB_00807b32;
|
|
}
|
|
}
|
|
break;
|
|
case 2:
|
|
(GHIDRA_CAST<Entity_Tear *>((GHIDRA_CAST<Entity_Tear *>(entity))))->Entity_Tear::TearFlags(GHIDRA_CAST<BitSet128 *>(tearFlags));
|
|
local_154 = 0.0;
|
|
local_130 = GHIDRA_CAST<ANM2 *>(0x0);
|
|
local_108 = GHIDRA_CAST<ANM2 *>((this->_roomList[0x99]._doors + 6));
|
|
local_12c = GHIDRA_CAST<ANM2 *>(0x3ecccccd);
|
|
pFVar7 = GHIDRA_CAST<Font *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(local_108))))->Sprite)::Color();
|
|
(GHIDRA_CAST<Font *>((pFVar7)))->Font::SetLineHeightModifier(0.0);
|
|
maskedTearFlags =
|
|
BitSet128::operator_and(GHIDRA_CAST<BitSet128 *>(local_148),GHIDRA_CAST<BitSet128 *>(tearFlags),&g_tearFlagGlow);
|
|
bVar3 = (GHIDRA_CAST<BitSet128 *>((maskedTearFlags)))->BitSet128::IsNonZero();
|
|
if (bVar3 != 0) {
|
|
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Color *>(()))->Color)::Color();
|
|
pAVar19 = local_108;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(local_108))))->Sprite::SetColor(color);
|
|
lightSprite = GHIDRA_CAST<ANM2 *>(((float)local_12c * 1.3));
|
|
local_154 = 2.0;
|
|
local_130 = GHIDRA_CAST<ANM2 *>(0x1);
|
|
local_12c = lightSprite;
|
|
goto LAB_00808404;
|
|
}
|
|
maskedTearFlags =
|
|
BitSet128::operator_and
|
|
(GHIDRA_CAST<BitSet128 *>(local_148),GHIDRA_CAST<BitSet128 *>(tearFlags),&g_tearFlagMysteriousLiquidCreep
|
|
);
|
|
bVar3 = (GHIDRA_CAST<BitSet128 *>((maskedTearFlags)))->BitSet128::IsNonZero();
|
|
if (bVar3 == 0) {
|
|
maskedTearFlags =
|
|
BitSet128::operator_and(GHIDRA_CAST<BitSet128 *>(local_148),GHIDRA_CAST<BitSet128 *>(tearFlags),&g_tearFlagBurn);
|
|
bVar3 = (GHIDRA_CAST<BitSet128 *>((maskedTearFlags)))->BitSet128::IsNonZero();
|
|
if (bVar3 != 0) goto LAB_00808253;
|
|
maskedTearFlags =
|
|
BitSet128::operator_and(GHIDRA_CAST<BitSet128 *>(local_148),GHIDRA_CAST<BitSet128 *>(tearFlags),&g_tearFlagHorn);
|
|
bVar3 = (GHIDRA_CAST<BitSet128 *>((maskedTearFlags)))->BitSet128::IsNonZero();
|
|
if (bVar3 != 0) goto LAB_00808253;
|
|
maskedTearFlags =
|
|
BitSet128::operator_and
|
|
(GHIDRA_CAST<BitSet128 *>(local_148),GHIDRA_CAST<BitSet128 *>(tearFlags),&g_tearFlagLightFromHeaven);
|
|
bVar3 = (GHIDRA_CAST<BitSet128 *>((maskedTearFlags)))->BitSet128::IsNonZero();
|
|
if (bVar3 != 0) goto LAB_00808253;
|
|
maskedTearFlags =
|
|
BitSet128::operator_and
|
|
(GHIDRA_CAST<BitSet128 *>(local_148),GHIDRA_CAST<BitSet128 *>(tearFlags),&g_tearFlagJacobs);
|
|
bVar3 = (GHIDRA_CAST<BitSet128 *>((maskedTearFlags)))->BitSet128::IsNonZero();
|
|
if (bVar3 == 0) {
|
|
iVar20 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Variant();
|
|
if (iVar20 == 0x2e) {
|
|
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Color *>(()))->Color)::Color();
|
|
pAVar19 = local_108;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(local_108))))->Sprite::SetColor(color);
|
|
local_154 = 2.0;
|
|
}
|
|
else {
|
|
bVar3 = IsInTimedSet(g_game,0x26);
|
|
if (bVar3 == 0) {
|
|
iVar20 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Variant();
|
|
if ((iVar20 == 0xd) || (iVar20 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Variant(), iVar20 == 0x17)) {
|
|
seeds = GHIDRA_CAST<Seeds *>(GetSeeds(g_game));
|
|
bVar3 = (GHIDRA_CAST<Seeds *>((seeds)))->Seeds::HasSeedEffect(0x4f);
|
|
if (bVar3 != 0) goto LAB_008083e7;
|
|
}
|
|
maskedTearFlags =
|
|
BitSet128::operator_and
|
|
(GHIDRA_CAST<BitSet128 *>(local_148),GHIDRA_CAST<BitSet128 *>(tearFlags),&g_tearFlagLudovico);
|
|
bVar3 = (GHIDRA_CAST<BitSet128 *>((maskedTearFlags)))->BitSet128::IsNonZero();
|
|
if ((bVar3 == 0) || (cVar2 = FUN_004f88e0(), cVar2 == '\0')) {
|
|
pAVar19 = local_108;
|
|
}
|
|
else {
|
|
lightSprite = GHIDRA_CAST<ANM2 *>(0x3f800000);
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&tmpColor))))->Color::Color(1.0,1.0,1.0,0.6);
|
|
pAVar19 = local_108;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(local_108))))->Sprite::SetColor(color_00);
|
|
}
|
|
}
|
|
else {
|
|
LAB_008083e7:
|
|
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Entity *>((entity)))->Entity)::GetColor();
|
|
pAVar19 = local_108;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(local_108))))->Sprite::SetColor(color);
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Color *>(()))->Color)::Color();
|
|
pAVar19 = local_108;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(local_108))))->Sprite::SetColor(color);
|
|
local_154 = 6.0;
|
|
}
|
|
}
|
|
else {
|
|
LAB_00808253:
|
|
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Color *>(()))->Color)::Color();
|
|
pAVar19 = local_108;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(local_108))))->Sprite::SetColor(color);
|
|
}
|
|
LAB_00808404:
|
|
FUN_0060cd50();
|
|
local_150.y = (float)lightSprite;
|
|
if (0.0 < (float)lightSprite) {
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(pAVar19))))->Sprite::Color();
|
|
pCVar8 = GHIDRA_CAST<Color *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(local_108))))->Sprite)::Color();
|
|
fVar23 = (GHIDRA_CAST<Color *>((pCVar8)))->Color::R();
|
|
local_100.y = fVar23 + local_150.y;
|
|
FUN_005cd370();
|
|
pFVar7 = GHIDRA_CAST<Font *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(local_108))))->Sprite)::Color();
|
|
pCVar8 = GHIDRA_CAST<Color *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(local_108))))->Sprite)::Color();
|
|
fVar23 = (GHIDRA_CAST<Color *>((pCVar8)))->Color::A();
|
|
local_100.y = fVar23 + local_150.y;
|
|
(GHIDRA_CAST<Font *>((pFVar7)))->Font::SetLineHeightModifier(local_100.y);
|
|
}
|
|
lightSprite = local_108;
|
|
pCVar8 = GHIDRA_CAST<Color *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(local_108))))->Sprite)::Color();
|
|
local_100.y = (GHIDRA_CAST<Color *>((pCVar8)))->Color::A();
|
|
if (0.0 < local_100.y) {
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((&g_vectorOne)))->Vector::__mul(&local_13c,GHIDRA_CAST<float *>(&local_12c));
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(lightSprite))))->Sprite::SetScale(pVVar5);
|
|
if (local_130 != GHIDRA_CAST<ANM2 *>(0x0)) {
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(lightSprite))))->Sprite::SetFrame_1(GHIDRA_INT(local_130));
|
|
}
|
|
pVVar5 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Position(&local_13c);
|
|
pVVar17 = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Entity *>((entity)))->Entity)::PositionOffset();
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(&local_128,pVVar17);
|
|
uVar16 = (GHIDRA_CAST<RNG *>((&flickerRng)))->RNG::Next();
|
|
pVVar17 = RandomVector(&local_110,uVar16);
|
|
pVVar17 = (GHIDRA_CAST<Vector *>((pVVar17)))->Vector::__mul(&local_120,&local_154);
|
|
bVar3 = 1;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(GHIDRA_CAST<Vector *>(local_178),pVVar17);
|
|
pVVar5 = Isaac::GetRenderPosition(&local_180,pVVar5,bVar3);
|
|
pVVar13 = &g_vectorZero;
|
|
pVVar17 = &g_vectorZero;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(&local_170,&renderOffsetLocal);
|
|
lightSprite = local_108;
|
|
(GHIDRA_CAST<ANM2 *>((local_108)))->ANM2::Render(pVVar5,pVVar17,pVVar13);
|
|
if (local_130 != GHIDRA_CAST<ANM2 *>(0x0)) {
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(lightSprite))))->Sprite::SetFrame_1(0);
|
|
}
|
|
}
|
|
break;
|
|
case 3:
|
|
if ((GHIDRA_CAST<Entity_Player *>(entity))->_variant == 0x3e) {
|
|
if ((GHIDRA_CAST<Entity_Player *>(entity))->_visible != 0) {
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&tmpColor))))->Color::Reset();
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&tmpColor))))->Color::SetTint(1.0,0.8,0.8,1.0);
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>((this->_roomList[0x9a]._doors + 2)))))->Color::operator_assign(&tmpColor);
|
|
fVar23 = g_vectorOne.y * 0.4;
|
|
this->_roomList[0x9a].AllowedDoors = GHIDRA_INT((g_vectorOne.x * 0.4));
|
|
this->_roomList[0x9a]._doors[0] = GHIDRA_INT(fVar23);
|
|
if (this->_roomList[0x99].SavedGridEntities._begin != (void *)0x0) {
|
|
AnimationState::SetFrameFloat
|
|
(GHIDRA_CAST<AnimationState *>(&this->_roomList[0x99].BossDeathSeed),1.0);
|
|
}
|
|
local_110.y = ((GHIDRA_CAST<Entity_Player *>(entity))->_pos).y - 14.0;
|
|
goto LAB_00807d20;
|
|
}
|
|
}
|
|
else if (((GHIDRA_CAST<Entity_Player *>(entity))->_variant == 0xce) &&
|
|
((GHIDRA_CAST<Entity_Player *>(entity))->_visible != 0)) {
|
|
local_1a8._unk = 0;
|
|
local_1a8._red = 0.6;
|
|
local_1a8._green = 0.6;
|
|
local_1a8._blue = 0.6;
|
|
local_1a8._alpha = 1.0;
|
|
FUN_00a0f750();
|
|
layer = (GHIDRA_CAST<ANM2 *>((&(GHIDRA_CAST<Entity_Player *>(entity))->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x0));
|
|
tmpColor._tint[0] = ((GHIDRA_CAST<Entity_Player *>(entity))->_sprite)._color._tint[0];
|
|
tmpColor._tint[1] = ((GHIDRA_CAST<Entity_Player *>(entity))->_sprite)._color._tint[1];
|
|
tmpColor._tint[2] = ((GHIDRA_CAST<Entity_Player *>(entity))->_sprite)._color._tint[2];
|
|
tmpColor._tint[3] = ((GHIDRA_CAST<Entity_Player *>(entity))->_sprite)._color._tint[3];
|
|
tmpColor._offset[2] = ((GHIDRA_CAST<Entity_Player *>(entity))->_sprite)._color._offset[2];
|
|
tmpColor._colorize[0] = ((GHIDRA_CAST<Entity_Player *>(entity))->_sprite)._color._colorize[0];
|
|
tmpColor._colorize[1] = ((GHIDRA_CAST<Entity_Player *>(entity))->_sprite)._color._colorize[1];
|
|
tmpColor._colorize[2] = ((GHIDRA_CAST<Entity_Player *>(entity))->_sprite)._color._colorize[2];
|
|
tmpColor._colorize[3] = ((GHIDRA_CAST<Entity_Player *>(entity))->_sprite)._color._colorize[3];
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(tmpColor._offset)) + 0x0))) = *GHIDRA_CAST<undefined8 *>(((GHIDRA_CAST<Entity_Player *>(entity))->_sprite)._color._offset);
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&tmpColor))))->Color::__mul(&layer->_color);
|
|
(GHIDRA_CAST<Color *>((&lightColor2)))->Color::operator_assign(&tmpColor);
|
|
Color::apply_to_kcolor(&layer0Color,GHIDRA_CAST<ColorMod *>(&lightColor2),&local_1a8);
|
|
local_1a8._unk = 0;
|
|
local_1a8._red = 0.6;
|
|
local_1a8._green = 0.6;
|
|
local_1a8._blue = 0.6;
|
|
local_1a8._alpha = 1.0;
|
|
FUN_00a0f750();
|
|
layer = (GHIDRA_CAST<ANM2 *>((&(GHIDRA_CAST<Entity_Player *>(entity))->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x1));
|
|
tmpColor._tint[0] = ((GHIDRA_CAST<Entity_Player *>(entity))->_sprite)._color._tint[0];
|
|
tmpColor._tint[1] = ((GHIDRA_CAST<Entity_Player *>(entity))->_sprite)._color._tint[1];
|
|
tmpColor._tint[2] = ((GHIDRA_CAST<Entity_Player *>(entity))->_sprite)._color._tint[2];
|
|
tmpColor._tint[3] = ((GHIDRA_CAST<Entity_Player *>(entity))->_sprite)._color._tint[3];
|
|
tmpColor._offset[2] = ((GHIDRA_CAST<Entity_Player *>(entity))->_sprite)._color._offset[2];
|
|
tmpColor._colorize[0] = ((GHIDRA_CAST<Entity_Player *>(entity))->_sprite)._color._colorize[0];
|
|
tmpColor._colorize[1] = ((GHIDRA_CAST<Entity_Player *>(entity))->_sprite)._color._colorize[1];
|
|
tmpColor._colorize[2] = ((GHIDRA_CAST<Entity_Player *>(entity))->_sprite)._color._colorize[2];
|
|
tmpColor._colorize[3] = ((GHIDRA_CAST<Entity_Player *>(entity))->_sprite)._color._colorize[3];
|
|
(*GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(&(tmpColor._offset)) + 0x0))) = *GHIDRA_CAST<undefined8 *>(((GHIDRA_CAST<Entity_Player *>(entity))->_sprite)._color._offset);
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&tmpColor))))->Color::__mul(&layer->_color);
|
|
(GHIDRA_CAST<Color *>((&lightColor2)))->Color::operator_assign(&tmpColor);
|
|
Color::apply_to_kcolor(GHIDRA_CAST<KColor *>((local_c8 + 0x18)),GHIDRA_CAST<ColorMod *>(&lightColor2),&local_1a8);
|
|
local_160.y = layer0Color._green;
|
|
local_188.y = layer0Color._red;
|
|
local_100.y = layer0Color._blue;
|
|
local_1b8.y = (float)local_ac;
|
|
local_1b0.y = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)local_c8)) + 0x18)));
|
|
local_194.y = (float)local_a8;
|
|
if (layer0Color._green * 0.7152 + layer0Color._red * 0.2126 + layer0Color._blue * 0.0722 <=
|
|
((float)local_ac * 0.7152 + (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)local_c8)) + 0x18))) * 0.2126 + (float)local_a8 * 0.0722)
|
|
- 0.25) {
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&tmpColor))))->Color::Reset();
|
|
lightSprite = GHIDRA_CAST<ANM2 *>(local_1b0.y);
|
|
pvVar11 = (void *)local_1b8.y;
|
|
pAVar19 = GHIDRA_CAST<ANM2 *>(local_194.y);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&tmpColor))))->Color::Reset();
|
|
lightSprite = GHIDRA_CAST<ANM2 *>(local_188.y);
|
|
pvVar11 = (void *)local_160.y;
|
|
pAVar19 = GHIDRA_CAST<ANM2 *>(local_100.y);
|
|
}
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&tmpColor))))->Color::SetTint((float)lightSprite,(float)pvVar11,(float)pAVar19,1.0);
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>((this->_roomList[0x9a]._doors + 2)))))->Color::operator_assign(&tmpColor);
|
|
layer = (GHIDRA_CAST<ANM2 *>((&(GHIDRA_CAST<Entity_Player *>(entity))->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x0));
|
|
fVar23 = (layer->_size).y;
|
|
this->_roomList[0x9a].AllowedDoors = GHIDRA_INT(((layer->_size).x * 0.4));
|
|
this->_roomList[0x9a]._doors[0] = GHIDRA_INT((fVar23 * 0.4));
|
|
if (this->_roomList[0x99].SavedGridEntities._begin != (void *)0x0) {
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(&this->_roomList[0x99].BossDeathSeed))))->AnimationState::SetFrameFloat(1.0);
|
|
}
|
|
local_110.y = ((GHIDRA_CAST<Entity_Player *>(entity))->_pos).y - 9.0;
|
|
LAB_00807d20:
|
|
local_110.x = ((GHIDRA_CAST<Entity_Player *>(entity))->_pos).x + 0.0;
|
|
pVVar5 = Isaac::GetRenderPosition(&local_13c,&local_110,1);
|
|
local_120.y = renderOffsetLocal.y + pVVar5->y;
|
|
local_120.x = renderOffsetLocal.x + pVVar5->x;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((this->_roomList[0x99]._doors + 6)))))->ANM2::Render(&local_120,&g_vectorZero,
|
|
&g_vectorZero);
|
|
if (this->_roomList[0x99].SavedGridEntities._begin != (void *)0x0) {
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(&this->_roomList[0x99].BossDeathSeed))))->AnimationState::SetFrameFloat(0.0);
|
|
}
|
|
}
|
|
break;
|
|
case 4:
|
|
iVar20 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Variant();
|
|
if (iVar20 == 8) {
|
|
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Color *>(()))->Color)::Color();
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((this->_roomList[0x99]._doors + 6)))))->Sprite::SetColor(color);
|
|
local_100.y = 0.75;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((&g_vectorOne)))->Vector::__mul(&local_13c,&local_100.y);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((this->_roomList[0x99]._doors + 6)))))->Sprite::SetScale(pVVar5);
|
|
pVVar17 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Position(&local_128);
|
|
pVVar5 = &local_13c;
|
|
goto LAB_00808e0d;
|
|
}
|
|
lightSprite = GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<Entity *>((entity)))->Entity)::GetSprite();
|
|
local_100.y = (float)(GHIDRA_CAST<ANM2 *>((lightSprite)))->ANM2::GetLayer(GHIDRA_CAST<byte *>("sparks"));
|
|
if (GHIDRA_CAST<ANM2 *>(local_100.y) != GHIDRA_CAST<ANM2 *>(0x0)) {
|
|
(GHIDRA_CAST<Entity *>((entity)))->Entity::GetSprite();
|
|
pAVar10 = GHIDRA_CAST<AnimationState *>(Config)::GetPillEffects();
|
|
iVar20 = _ptr_deref_or_minus1();
|
|
pvVar11 = (GHIDRA_CAST<AnimationState *>((pAVar10)))->AnimationState::GetLayerFrame(iVar20);
|
|
if ((pvVar11 != (void *)0x0) && (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar11) + 0x2c)) != '\0')) {
|
|
local_100.y = 0.5;
|
|
pVVar5 = Vector::operator_mul(&local_13c,&local_100.y,GHIDRA_CAST<Vector *>((GHIDRA_INT(pvVar11) + 8)));
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__sub(&local_128,GHIDRA_CAST<Vector *>((GHIDRA_INT(pvVar11) + 0x20)));
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::Mul(&local_110,GHIDRA_CAST<Vector *>((GHIDRA_INT(pvVar11) + 0x18)));
|
|
(GHIDRA_CAST<Vector *>((GHIDRA_CAST<Vector *>((GHIDRA_INT(pvVar11) + 0x10)))))->Vector::__add(&local_160,pVVar5);
|
|
sprite = GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Entity *>((entity)))->Entity)::GetSprite();
|
|
fVar21 = (float10)(GHIDRA_CAST<Sprite *>((sprite)))->Sprite::Rotation();
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((&local_160)))->Vector::Rotated(&local_13c,(float)fVar21);
|
|
(GHIDRA_CAST<Vector *>((&local_160)))->Vector::operator_assign(pVVar5);
|
|
sprite = GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Entity *>((entity)))->Entity)::GetSprite();
|
|
(GHIDRA_CAST<Sprite *>((sprite)))->Sprite::Scale();
|
|
FUN_00a10570();
|
|
sprite = GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Entity *>((entity)))->Entity)::GetSprite();
|
|
cVar2 = (GHIDRA_CAST<Sprite *>((sprite)))->Sprite::FlipX();
|
|
if (cVar2 != '\0') {
|
|
local_160.x = -local_160.x;
|
|
}
|
|
sprite = GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Entity *>((entity)))->Entity)::GetSprite();
|
|
cVar2 = (GHIDRA_CAST<Sprite *>((sprite)))->Sprite::FlipY();
|
|
if (cVar2 != '\0') {
|
|
local_160.y = (float)(GHIDRA_UINT(local_160.y) ^ 0x80000000);
|
|
}
|
|
lightSprite = &room->_lightSprite;
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&tmpColor))))->Color::Color(1.0,0.8,0.2,1.0);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(lightSprite))))->Sprite::SetColor(color_01);
|
|
local_100.y = 0.3;
|
|
pVVar5 = Vector::operator_mul(&local_13c,&local_100.y,&g_vectorOne);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(lightSprite))))->Sprite::SetScale(pVVar5);
|
|
pVVar5 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(lightEntity))))->Entity::Position(&local_128);
|
|
pVVar17 = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(lightEntity))))->Entity)::PositionOffset();
|
|
bVar3 = 1;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(&local_13c,pVVar17);
|
|
pVVar5 = Isaac::GetRenderPosition(&local_110,pVVar5,bVar3);
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(&local_120,&renderOffsetLocal);
|
|
pVVar13 = &g_vectorZero;
|
|
pVVar17 = &g_vectorZero;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(GHIDRA_CAST<Vector *>(local_178),&local_160);
|
|
goto LAB_00807b32;
|
|
}
|
|
}
|
|
break;
|
|
default:
|
|
goto switchD_008072ae_caseD_5;
|
|
case 7:
|
|
cVar2 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Visible();
|
|
if (cVar2 == '\0') break;
|
|
sprite = GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Entity *>((entity)))->Entity)::GetSprite();
|
|
local_100.y = (float)(GHIDRA_CAST<Sprite *>((sprite)))->Sprite::GetNullFrame(GHIDRA_CAST<byte *>("Light"));
|
|
if (GHIDRA_CAST<ANM2 *>(local_100.y) == GHIDRA_CAST<ANM2 *>(0x0)) {
|
|
variant = (GHIDRA_CAST<Entity *>((entity)))->Entity::Variant();
|
|
switch(variant) {
|
|
case 3:
|
|
case 10:
|
|
break;
|
|
case 4:
|
|
break;
|
|
case 5:
|
|
case 8:
|
|
break;
|
|
default:
|
|
(GHIDRA_CAST<Entity *>((entity)))->Entity::GetSprite();
|
|
lightSprite = GHIDRA_CAST<ANM2 *>((this->_roomList[0x99]._doors + 6));
|
|
local_108 = lightSprite;
|
|
cVar2 = _has_flag_0x110();
|
|
if (cVar2 == '\0') {
|
|
(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(lightEntity))))->Entity)::GetColor();
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(entityColor))))->Color::operator_assign(color);
|
|
color = GHIDRA_CAST<ColorMod *>(FUN_004072e0());
|
|
lightSprite = local_108;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(local_108))))->Sprite::SetColor(color);
|
|
local_108 = lightSprite;
|
|
goto LAB_008087d4;
|
|
}
|
|
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Entity *>((entity)))->Entity)::GetColor();
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(lightSprite))))->Sprite::SetColor(color);
|
|
goto LAB_008087da;
|
|
case 7:
|
|
}
|
|
local_108 = GHIDRA_CAST<ANM2 *>((this->_roomList[0x99]._doors + 6));
|
|
(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(lightEntity))))->Entity)::GetColor();
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(entityColor))))->Color::operator_assign(color);
|
|
color = GHIDRA_CAST<ColorMod *>(FUN_004072e0());
|
|
lightSprite = local_108;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(local_108))))->Sprite::SetColor(color);
|
|
LAB_008087d4:
|
|
entity = GHIDRA_CAST<Entity *>(lightEntity);
|
|
LAB_008087da:
|
|
iVar20 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Variant();
|
|
if (((iVar20 == 2) || (iVar20 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Variant(), iVar20 == 10)) ||
|
|
(iVar20 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Variant(), iVar20 == 7)) {
|
|
pfVar4 = GHIDRA_CAST<float *>((GHIDRA_CAST<Entity *>((entity)))->Entity)::SpriteScale();
|
|
local_100.y = *pfVar4 * 0.35;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((&g_vectorOne)))->Vector::__mul(&local_13c,&local_100.y);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(lightSprite))))->Sprite::SetScale(pVVar5);
|
|
local_108 = lightSprite;
|
|
}
|
|
else {
|
|
pfVar4 = GHIDRA_CAST<float *>((GHIDRA_CAST<Entity *>((entity)))->Entity)::SpriteScale();
|
|
local_100.y = *pfVar4 * 0.75;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((&g_vectorOne)))->Vector::__mul(&local_13c,&local_100.y);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(lightSprite))))->Sprite::SetScale(pVVar5);
|
|
}
|
|
}
|
|
else {
|
|
local_108 = GHIDRA_CAST<ANM2 *>((this->_roomList[0x99]._doors + 6));
|
|
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(lightEntity))))->Entity)::GetColor();
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(entityColor))))->Color::operator_assign(color);
|
|
color = GHIDRA_CAST<ColorMod *>(FUN_004072e0());
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(local_108))))->Sprite::SetColor(color);
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((&g_vectorOne)))->Vector::Mul(&local_13c,GHIDRA_CAST<Vector *>(&(GHIDRA_CAST<std_string *>(local_100.y))->_size));
|
|
entity = GHIDRA_CAST<Entity *>(lightEntity);
|
|
pfVar4 = GHIDRA_CAST<float *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(lightEntity))))->Entity)::SpriteScale();
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__mul(&local_128,pfVar4);
|
|
lightSprite = local_108;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(local_108))))->Sprite::SetScale(pVVar5);
|
|
}
|
|
(GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<EntityPtr *>(&local_170))))->EntityPtr::clear();
|
|
pVVar5 = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Entity *>((entity)))->Entity)::PositionOffset();
|
|
pVVar5 = Vector::mul_065(&local_13c,pVVar5);
|
|
(GHIDRA_CAST<Vector *>((&renderOffsetLocal)))->Vector::__add(&local_120,pVVar5);
|
|
cVar2 = (GHIDRA_CAST<Entity_Laser *>((GHIDRA_CAST<Entity_Laser *>(entity))))->Entity_Laser::IsSampleLaser();
|
|
if (cVar2 == '\0') {
|
|
pVVar5 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Position(&local_13c);
|
|
pVVar17 = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Entity *>((entity)))->Entity)::PositionOffset();
|
|
(GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(GHIDRA_CAST<Vector *>(local_178),pVVar17);
|
|
laserEndPoint = GHIDRA_CAST<int *>((GHIDRA_CAST<Entity_Laser *>((GHIDRA_CAST<Entity_Laser *>(entity))))->Entity_Laser)::GetEndPoint();
|
|
local_180.x = (float)*laserEndPoint;
|
|
local_180.y = (float)laserEndPoint[1];
|
|
local_150.y = 0.0;
|
|
do {
|
|
local_130 = GHIDRA_CAST<ANM2 *>(((float)GHIDRA_INT(local_150.y) / 19.0));
|
|
iVar20 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Variant();
|
|
if (iVar20 == 4) {
|
|
pfVar4 = GHIDRA_CAST<float *>((GHIDRA_CAST<Entity *>((entity)))->Entity)::SpriteScale();
|
|
local_100.y = ((float)local_130 * 0.7 + 0.3) * *pfVar4 * 0.75;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((&g_vectorOne)))->Vector::__mul(&local_13c,&local_100.y);
|
|
lightSprite = local_108;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(local_108))))->Sprite::SetScale(pVVar5);
|
|
}
|
|
else {
|
|
lightSprite = local_108;
|
|
}
|
|
bVar3 = 1;
|
|
pVVar5 = vector_lerp(&local_128,GHIDRA_CAST<Vector *>(local_178),&local_180,0,(float)local_130);
|
|
Isaac::GetRenderPosition(&local_110,pVVar5,bVar3);
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((&local_110)))->Vector::__sub(&local_188,&local_170);
|
|
local_160.y = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::LengthSquared();
|
|
if (0.0 <= local_160.y) {
|
|
(GHIDRA_CAST<Vector *>((&local_170)))->Vector::operator_assign(&local_110);
|
|
bVar3 = 1;
|
|
pVVar5 = vector_lerp(&local_194,GHIDRA_CAST<Vector *>(local_178),&local_180,0,(float)local_130);
|
|
pVVar5 = Isaac::GetRenderPosition(&local_1b8,pVVar5,bVar3);
|
|
pVVar13 = &g_vectorZero;
|
|
pVVar17 = &g_vectorZero;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(&local_1b0,&renderOffsetLocal);
|
|
(GHIDRA_CAST<ANM2 *>((lightSprite)))->ANM2::Render(pVVar5,pVVar17,pVVar13);
|
|
}
|
|
local_150.y = (float)(GHIDRA_INT((GHIDRA_CAST<std_string *>(local_150.y))->_buf) + 1);
|
|
} while (GHIDRA_INT(local_150.y) < 0x14);
|
|
}
|
|
else {
|
|
local_108 = (GHIDRA_CAST<Entity_Laser *>((GHIDRA_CAST<Entity_Laser *>(entity))))->Entity_Laser::GetNonOptimizedSamples();
|
|
iVar20 = FUN_0042f160();
|
|
if (iVar20 != 0) {
|
|
iVar20 = FUN_0042f160();
|
|
local_160.y = 1.4013e-45;
|
|
local_100.y = (float)(iVar20 / 0x14);
|
|
pfVar4 = GHIDRA_CAST<float *>(std)::max<int>();
|
|
uVar16 = 0;
|
|
local_160.y = *pfVar4;
|
|
iVar20 = FUN_0042f160();
|
|
if (iVar20 != 0) {
|
|
do {
|
|
bVar3 = 1;
|
|
pVVar5 = GHIDRA_CAST<Vector *>(std)::vector<Vector>::operator__();
|
|
Isaac::GetRenderPosition(&local_110,pVVar5,bVar3);
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((&local_110)))->Vector::__sub(&local_13c,&local_170);
|
|
local_100.y = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::LengthSquared();
|
|
if (0.0 <= local_100.y) {
|
|
(GHIDRA_CAST<Vector *>((&local_170)))->Vector::operator_assign(&local_110);
|
|
bVar3 = 1;
|
|
pVVar5 = GHIDRA_CAST<Vector *>(std)::vector<Vector>::operator__();
|
|
pVVar5 = Isaac::GetRenderPosition(&local_128,pVVar5,bVar3);
|
|
pVVar13 = &g_vectorZero;
|
|
pVVar17 = &g_vectorZero;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(GHIDRA_CAST<Vector *>(local_178),&local_120);
|
|
(GHIDRA_CAST<ANM2 *>((lightSprite)))->ANM2::Render(pVVar5,pVVar17,pVVar13);
|
|
}
|
|
uVar16 = uVar16 + GHIDRA_INT(local_160.y);
|
|
uVar9 = FUN_0042f160();
|
|
} while (uVar16 < uVar9);
|
|
}
|
|
bVar3 = 1;
|
|
pVVar5 = GHIDRA_CAST<Vector *>(EntityPtr)::Ref();
|
|
pVVar5 = Isaac::GetRenderPosition(&local_13c,pVVar5,bVar3);
|
|
pVVar13 = &g_vectorZero;
|
|
pVVar17 = &g_vectorZero;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(&local_128,&local_120);
|
|
goto LAB_00807b32;
|
|
}
|
|
}
|
|
break;
|
|
case 9:
|
|
iVar20 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Variant();
|
|
if (iVar20 == 2) {
|
|
sprite = GHIDRA_CAST<Sprite *>((this->_roomList[0x99]._doors + 6));
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(lightEntity))))->Entity::GetColor();
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(entityColor))))->Color::Color(1.0,0.8,0.3,1.0);
|
|
color = GHIDRA_CAST<ColorMod *>(FUN_004072e0());
|
|
(GHIDRA_CAST<Sprite *>((sprite)))->Sprite::SetColor(color);
|
|
(GHIDRA_CAST<Sprite *>((sprite)))->Sprite::SetScale(&g_vectorOne);
|
|
bVar3 = 1;
|
|
pVVar5 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(lightEntity))))->Entity::Position(&local_13c);
|
|
pVVar5 = Isaac::GetRenderPosition(&local_128,pVVar5,bVar3);
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(&local_110,&renderOffsetLocal);
|
|
uVar16 = (GHIDRA_CAST<RNG *>((&flickerRng)))->RNG::Next();
|
|
pVVar17 = RandomVector(&local_120,uVar16);
|
|
fVar23 = (GHIDRA_CAST<RNG *>((&flickerRng)))->RNG::RandomFloat();
|
|
local_100.y = fVar23 * 3.0;
|
|
pVVar17 = (GHIDRA_CAST<Vector *>((pVVar17)))->Vector::__mul(GHIDRA_CAST<Vector *>(local_178),&local_100.y);
|
|
pVVar12 = &g_vectorZero;
|
|
pVVar13 = &g_vectorZero;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(&local_180,pVVar17);
|
|
pRVar18 = room;
|
|
(GHIDRA_CAST<ANM2 *>((&room->_lightSprite)))->ANM2::Render(pVVar5,pVVar13,pVVar12);
|
|
goto LAB_00807b3d;
|
|
}
|
|
local_100.y = (GHIDRA_CAST<Room *>((GHIDRA_CAST<Room *>(this))))->Room::GetLightingAlpha();
|
|
if (0.5 < local_100.y) {
|
|
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Color *>(()))->Color)::Color();
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((this->_roomList[0x99]._doors + 6)))))->Sprite::SetColor(color);
|
|
local_100.y = 0.1;
|
|
goto LAB_0080ae36;
|
|
}
|
|
}
|
|
goto switchD_00809dea_caseD_2;
|
|
}
|
|
if (iVar20 < 0x332) {
|
|
if (iVar20 == 0x331) {
|
|
if ((GHIDRA_CAST<Entity_Player *>(entity))->_variant == 1) {
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&tmpColor))))->Color::Reset();
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&tmpColor))))->Color::SetTint(1.0,0.8,0.4,1.0);
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>((this->_roomList[0x9a]._doors + 2)))))->Color::operator_assign(&tmpColor);
|
|
this->_roomList[0x9a].AllowedDoors = GHIDRA_INT(g_vectorOne.x);
|
|
this->_roomList[0x9a]._doors[0] = GHIDRA_INT(g_vectorOne.y);
|
|
local_110.x = ((GHIDRA_CAST<Entity_Player *>(entity))->_pos).x + 0.0;
|
|
local_110.y = ((GHIDRA_CAST<Entity_Player *>(entity))->_pos).y - 16.0;
|
|
pVVar5 = Isaac::GetRenderPosition(&local_13c,&local_110,1);
|
|
local_100.y = renderOffsetLocal.x + pVVar5->x;
|
|
local_160.y = renderOffsetLocal.y + pVVar5->y;
|
|
uVar16 = (GHIDRA_CAST<RNG *>((&flickerRng)))->RNG::Next();
|
|
pVVar5 = RandomVector(&local_128,uVar16);
|
|
(GHIDRA_CAST<RNG *>((&flickerRng)))->RNG::Next();
|
|
fVar23 = (float)((double)flickerRng._seed +
|
|
__uint_to_double_fixup[-(flickerRng._seed >> 0x1f)]) * 2.3283062e-10;
|
|
fVar23 = fVar23 + fVar23;
|
|
local_120.y = pVVar5->y * fVar23 + local_160.y;
|
|
local_120.x = fVar23 * pVVar5->x + local_100.y;
|
|
goto LAB_00809a2f;
|
|
}
|
|
}
|
|
else {
|
|
if (iVar20 < 0x108) {
|
|
if (iVar20 == 0x107) {
|
|
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Color *>(()))->Color)::Color();
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((this->_roomList[0x99]._doors + 6)))))->Sprite::SetColor(color);
|
|
local_100.y = 2.0;
|
|
LAB_0080968a:
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((&g_vectorOne)))->Vector::__mul(&local_13c,&local_100.y);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((this->_roomList[0x99]._doors + 6)))))->Sprite::SetScale(pVVar5);
|
|
pVVar5 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Position(&local_128);
|
|
pVVar17 = (GHIDRA_CAST<Vector *>((&local_13c)))->Vector::Vector(0.0,-15.0);
|
|
bVar3 = 1;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(&local_110,pVVar17);
|
|
pVVar5 = Isaac::GetRenderPosition(&local_120,pVVar5,bVar3);
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(GHIDRA_CAST<Vector *>(local_178),&renderOffsetLocal);
|
|
uVar16 = (GHIDRA_CAST<RNG *>((&flickerRng)))->RNG::Next();
|
|
pVVar17 = RandomVector(&local_180,uVar16);
|
|
local_100.y = (GHIDRA_CAST<RNG *>((&flickerRng)))->RNG::RandomFloat();
|
|
goto LAB_0080972b;
|
|
}
|
|
if (iVar20 != 0x21) {
|
|
if (iVar20 != 0x55) goto switchD_008072ae_caseD_5;
|
|
iVar20 = (GHIDRA_CAST<Room *>((GHIDRA_CAST<Room *>(this))))->Room::GetBossID();
|
|
if (iVar20 != 0x33) {
|
|
cVar2 = FUN_004f88e0();
|
|
if (cVar2 == '\0') goto switchD_00809dea_caseD_2;
|
|
}
|
|
lightSprite = GHIDRA_CAST<ANM2 *>((this->_roomList[0x99]._doors + 6));
|
|
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Color *>(()))->Color)::Color();
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(lightSprite))))->Sprite::SetColor(color);
|
|
local_100.y = 0.3;
|
|
goto LAB_008092a3;
|
|
}
|
|
fVar21 = (float10)(GHIDRA_CAST<Entity *>((entity)))->Entity::HitPoints();
|
|
local_100.y = (float)fVar21;
|
|
if (local_100.y <= 1.0) goto switchD_00809dea_caseD_2;
|
|
fVar21 = (float10)(GHIDRA_CAST<Entity *>((entity)))->Entity::HitPoints();
|
|
local_100.y = (float)fVar21;
|
|
fVar23 = (GHIDRA_CAST<Entity *>((entity)))->Entity::MaxHitPoints();
|
|
local_150.y = 1.0;
|
|
local_12c = GHIDRA_CAST<ANM2 *>((1.0 - local_100.y / fVar23));
|
|
iVar20 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Variant();
|
|
if ((((iVar20 == 3) || (iVar20 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Variant(), iVar20 == 0xd)) ||
|
|
(iVar20 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Variant(), iVar20 == 2)) ||
|
|
(iVar20 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Variant(), iVar20 == 0xc)) {
|
|
local_108 = GHIDRA_CAST<ANM2 *>((this->_roomList[0x99]._doors + 6));
|
|
LAB_00809546:
|
|
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Color *>(()))->Color)::Color();
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((this->_roomList[0x99]._doors + 6)))))->Sprite::SetColor(color);
|
|
}
|
|
else {
|
|
sprite = GHIDRA_CAST<Sprite *>((this->_roomList[0x99]._doors + 6));
|
|
local_154 = 1.0 - (float)local_12c * 0.5;
|
|
local_108 = GHIDRA_CAST<ANM2 *>(sprite);
|
|
iVar20 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Variant();
|
|
if (iVar20 == 1) goto LAB_00809546;
|
|
iVar20 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Variant();
|
|
if ((iVar20 == 4) || (iVar20 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Variant(), iVar20 != 0xb)) {
|
|
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Color *>(()))->Color)::Color();
|
|
(GHIDRA_CAST<Sprite *>((sprite)))->Sprite::SetColor(color);
|
|
local_108 = GHIDRA_CAST<ANM2 *>(sprite);
|
|
}
|
|
else {
|
|
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Color *>(()))->Color)::Color();
|
|
(GHIDRA_CAST<Sprite *>((sprite)))->Sprite::SetColor(color);
|
|
local_150.y = 0.4;
|
|
local_108 = GHIDRA_CAST<ANM2 *>(sprite);
|
|
}
|
|
}
|
|
local_160.y = 1.2 - (float)local_12c * 0.2;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((&g_vectorOne)))->Vector::__mul(&local_13c,&local_160.y);
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__mul(&local_128,&local_150.y);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((this->_roomList[0x99]._doors + 6)))))->Sprite::SetScale(pVVar5);
|
|
bVar3 = 1;
|
|
pVVar5 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Position(&local_110);
|
|
pVVar5 = Isaac::GetRenderPosition(&local_13c,pVVar5,bVar3);
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(&local_128,&renderOffsetLocal);
|
|
uVar16 = (GHIDRA_CAST<RNG *>((&flickerRng)))->RNG::Next();
|
|
pVVar17 = RandomVector(&local_120,uVar16);
|
|
fVar23 = (GHIDRA_CAST<RNG *>((&flickerRng)))->RNG::RandomFloat();
|
|
local_100.y = fVar23 * 3.0;
|
|
pVVar12 = (GHIDRA_CAST<Vector *>((pVVar17)))->Vector::__mul(GHIDRA_CAST<Vector *>(local_178),&local_100.y);
|
|
pVVar13 = &g_vectorZero;
|
|
pVVar17 = &g_vectorZero;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(&local_180,pVVar12);
|
|
lightSprite = local_108;
|
|
goto LAB_00807b32;
|
|
}
|
|
if (iVar20 == 0x111) {
|
|
iVar20 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Variant();
|
|
if (iVar20 == 10) {
|
|
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Color *>(()))->Color)::Color();
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((this->_roomList[0x99]._doors + 6)))))->Sprite::SetColor(color);
|
|
local_100.y = 1.5;
|
|
goto LAB_0080968a;
|
|
}
|
|
}
|
|
else {
|
|
if (iVar20 != 0x328) goto switchD_008072ae_caseD_5;
|
|
if ((GHIDRA_CAST<Entity_Player *>(entity))->_visible != 0) {
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&tmpColor))))->Color::Reset();
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&tmpColor))))->Color::SetTint(1.0,0.8,0.4,1.0);
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>((this->_roomList[0x9a]._doors + 2)))))->Color::operator_assign(&tmpColor);
|
|
fVar23 = g_vectorOne.y * 0.8;
|
|
this->_roomList[0x9a].AllowedDoors = GHIDRA_INT((g_vectorOne.x * 0.8));
|
|
this->_roomList[0x9a]._doors[0] = GHIDRA_INT(fVar23);
|
|
local_110.x = ((GHIDRA_CAST<Entity_Player *>(entity))->_pos).x + 0.0;
|
|
local_110.y = ((GHIDRA_CAST<Entity_Player *>(entity))->_pos).y - 16.0;
|
|
pVVar5 = Isaac::GetRenderPosition(&local_13c,&local_110,1);
|
|
lightSprite = GHIDRA_CAST<ANM2 *>((this->_roomList[0x99]._doors + 6));
|
|
local_120.y = renderOffsetLocal.y + pVVar5->y;
|
|
local_120.x = renderOffsetLocal.x + pVVar5->x;
|
|
pVVar13 = &g_vectorZero;
|
|
pVVar17 = &g_vectorZero;
|
|
pVVar5 = &local_120;
|
|
goto LAB_00807b32;
|
|
}
|
|
}
|
|
}
|
|
goto switchD_00809dea_caseD_2;
|
|
}
|
|
switch(iVar20) {
|
|
case 0x332:
|
|
if ((GHIDRA_CAST<Entity_Player *>(entity))->_variant == 2) {
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&tmpColor))))->Color::Reset();
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&tmpColor))))->Color::SetTint(1.0,1.0,0.7,1.0);
|
|
tmpColor._offset[0] = 0.0;
|
|
tmpColor._offset[1] = 0.0;
|
|
tmpColor._offset[2] = 0.0;
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>((this->_roomList[0x9a]._doors + 2)))))->Color::operator_assign(&tmpColor);
|
|
local_188.y = (float)(this->_roomList[0x99]._doors + 6);
|
|
fVar23 = g_vectorOne.y * 0.6;
|
|
this->_roomList[0x9a].AllowedDoors = GHIDRA_INT((g_vectorOne.x * 0.6));
|
|
this->_roomList[0x9a]._doors[0] = GHIDRA_INT(fVar23);
|
|
if (this->_roomList[0x99].SavedGridEntities._begin != (void *)0x0) {
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(&this->_roomList[0x99].BossDeathSeed))))->AnimationState::SetFrameFloat(1.0);
|
|
}
|
|
local_110.y = ((GHIDRA_CAST<Entity_Player *>(entity))->_pos).y;
|
|
local_110.x = ((GHIDRA_CAST<Entity_Player *>(entity))->_pos).x;
|
|
pVVar5 = Isaac::GetRenderPosition(&local_13c,&local_110,1);
|
|
local_100.y = renderOffsetLocal.x + pVVar5->x;
|
|
local_160.y = renderOffsetLocal.y + pVVar5->y;
|
|
uVar16 = (GHIDRA_CAST<RNG *>((&flickerRng)))->RNG::Next();
|
|
pVVar5 = RandomVector(&local_128,uVar16);
|
|
(GHIDRA_CAST<RNG *>((&flickerRng)))->RNG::Next();
|
|
fVar23 = (float)((double)flickerRng._seed +
|
|
__uint_to_double_fixup[-(flickerRng._seed >> 0x1f)]) * 2.3283062e-10 * 3.0;
|
|
local_120.y = fVar23 * pVVar5->y + local_160.y;
|
|
local_120.x = fVar23 * pVVar5->x + local_100.y;
|
|
LAB_00809c03:
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(local_188.y))))->ANM2::Render(&local_120,&g_vectorZero,&g_vectorZero);
|
|
LAB_00809c21:
|
|
pRVar18 = room;
|
|
if ((room->_lightSprite)._animState._animData != (void *)0x0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(room->_lightSprite)._animState)))->AnimationState::SetFrameFloat(0.0);
|
|
}
|
|
goto LAB_00807b3d;
|
|
}
|
|
break;
|
|
default:
|
|
switchD_008072ae_caseD_5:
|
|
bVar3 = (GHIDRA_CAST<Entity *>((entity)))->Entity::IsEnemy();
|
|
if ((((bVar3 == 0) || (uVar16 = (GHIDRA_CAST<Entity *>((entity)))->Entity::GetEntityFlags(), (uVar16 & 0x1000) == 0)) &&
|
|
(bVar3 = (GHIDRA_CAST<Entity *>((entity)))->Entity::IsType(0x36,-1,-1), bVar3 == 0)) &&
|
|
((bVar3 = (GHIDRA_CAST<Entity *>((entity)))->Entity::IsType(10,2,-1), bVar3 == 0 &&
|
|
(bVar3 = (GHIDRA_CAST<Entity *>((entity)))->Entity::IsType(0xd0,2,-1), bVar3 == 0)))) {
|
|
bVar3 = (GHIDRA_CAST<Entity *>((entity)))->Entity::IsType(0xe2,2,-1);
|
|
if (bVar3 == 0) break;
|
|
}
|
|
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Color *>(()))->Color)::Color();
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((this->_roomList[0x99]._doors + 6)))))->Sprite::SetColor(color);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((this->_roomList[0x99]._doors + 6)))))->Sprite::SetScale(&g_vectorOne);
|
|
pVVar5 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Position(&local_13c);
|
|
pVVar17 = (GHIDRA_CAST<Vector *>((&local_128)))->Vector::Vector(0.0,-15.0);
|
|
bVar3 = 1;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(&local_110,pVVar17);
|
|
pVVar5 = Isaac::GetRenderPosition(&local_120,pVVar5,bVar3);
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(GHIDRA_CAST<Vector *>(local_178),&renderOffsetLocal);
|
|
uVar16 = (GHIDRA_CAST<RNG *>((&flickerRng)))->RNG::Next();
|
|
pVVar17 = RandomVector(&local_180,uVar16);
|
|
fVar23 = (GHIDRA_CAST<RNG *>((&flickerRng)))->RNG::RandomFloat();
|
|
local_100.y = fVar23 * 3.0;
|
|
goto LAB_0080972b;
|
|
case 0x387:
|
|
iVar20 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Variant();
|
|
if (iVar20 == 0) {
|
|
iVar20 = FUN_00447760();
|
|
if (iVar20 == 0x71) {
|
|
LAB_0080b3a9:
|
|
sprite = GHIDRA_CAST<Sprite *>((this->_roomList[0x99]._doors + 6));
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&tmpColor))))->Color::Color(1.0,0.0,0.0,1.0);
|
|
(GHIDRA_CAST<Sprite *>((sprite)))->Sprite::SetColor(color_04);
|
|
(GHIDRA_CAST<Sprite *>((sprite)))->Sprite::SetScale(&g_vectorOne);
|
|
pVVar17 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(lightEntity))))->Entity::Position(&local_13c);
|
|
pVVar5 = &local_128;
|
|
}
|
|
else {
|
|
iVar20 = FUN_00447760();
|
|
if (iVar20 != 0x68) break;
|
|
sprite = GHIDRA_CAST<Sprite *>((this->_roomList[0x99]._doors + 6));
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&tmpColor))))->Color::Color(1.0,0.0,0.0,1.0);
|
|
(GHIDRA_CAST<Sprite *>((sprite)))->Sprite::SetColor(color_05);
|
|
local_100.y = 1.5;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((&g_vectorOne)))->Vector::__mul(&local_13c,&local_100.y);
|
|
(GHIDRA_CAST<Sprite *>((sprite)))->Sprite::SetScale(pVVar5);
|
|
pVVar17 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(lightEntity))))->Entity::Position(&local_128);
|
|
pVVar5 = &local_13c;
|
|
}
|
|
lightSprite = GHIDRA_CAST<ANM2 *>((this->_roomList[0x99]._doors + 6));
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::Vector(0.0,-14.0);
|
|
bVar3 = 1;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar17)))->Vector::__add(&local_110,pVVar5);
|
|
pVVar5 = Isaac::GetRenderPosition(&local_120,pVVar5,bVar3);
|
|
pVVar13 = &g_vectorZero;
|
|
pVVar17 = &g_vectorZero;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(GHIDRA_CAST<Vector *>(local_178),&renderOffsetLocal);
|
|
goto LAB_00807b32;
|
|
}
|
|
iVar20 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Variant();
|
|
if (iVar20 == 1) {
|
|
iVar20 = FUN_00447760();
|
|
if (0x68 < iVar20) goto LAB_0080b3a9;
|
|
}
|
|
else {
|
|
iVar20 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Variant();
|
|
if (iVar20 == 0x14) {
|
|
sprite = GHIDRA_CAST<Sprite *>((this->_roomList[0x99]._doors + 6));
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&tmpColor))))->Color::Color(1.0,0.0,0.0,1.0);
|
|
(GHIDRA_CAST<Sprite *>((sprite)))->Sprite::SetColor(color_06);
|
|
local_100.y = 0.6;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((&g_vectorOne)))->Vector::__mul(&local_13c,&local_100.y);
|
|
(GHIDRA_CAST<Sprite *>((sprite)))->Sprite::SetScale(pVVar5);
|
|
(GHIDRA_CAST<Sprite *>((sprite)))->Sprite::SetFrame_1(1);
|
|
pVVar5 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(lightEntity))))->Entity::Position(&local_128);
|
|
pVVar17 = (GHIDRA_CAST<Vector *>((&local_13c)))->Vector::Vector(0.0,-14.0);
|
|
bVar3 = 1;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(&local_110,pVVar17);
|
|
pVVar17 = Isaac::GetRenderPosition(&local_120,pVVar5,bVar3);
|
|
pVVar5 = GHIDRA_CAST<Vector *>(local_178);
|
|
goto LAB_0080a2e8;
|
|
}
|
|
}
|
|
break;
|
|
case 0x389:
|
|
(GHIDRA_CAST<Entity *>((entity)))->Entity::GetSprite();
|
|
local_EAX_18866 = GHIDRA_CAST<GridEntity *>(Config)::GetPillEffects();
|
|
local_12c = GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<GridEntity *>((local_EAX_18866)))->GridEntity)::GetType();
|
|
if (local_12c != GHIDRA_CAST<ANM2 *>(0x0)) {
|
|
uVar16 = 0;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_INT((local_12c->_animDefaultName)._buf) + 4)) != 0) {
|
|
local_150.y = 0.0;
|
|
do {
|
|
local_130 = *GHIDRA_CAST<ANM2 **>((GHIDRA_INT((GHIDRA_CAST<std_string *>(local_150.y))->_buf) +
|
|
*GHIDRA_CAST<int *>((local_12c->_animDefaultName)._buf)));
|
|
sprite = GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Entity *>((entity)))->Entity)::GetSprite();
|
|
(GHIDRA_CAST<Sprite *>((sprite)))->Sprite::GetLayer(GHIDRA_CAST<byte *>(local_130));
|
|
layerName = GHIDRA_CAST<std_string *>(_get_name_string());
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 1;
|
|
isFlameLayer = str_eq_cstr(layerName,GHIDRA_CAST<byte *>("flame"));
|
|
local_14 = (float)((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8);
|
|
(GHIDRA_CAST<std::string *>((local_c8 + 0x14)))->std::string::_Tidy_deallocate();
|
|
if (isFlameLayer != 0) {
|
|
if (-1 < GHIDRA_INT(uVar16)) {
|
|
(GHIDRA_CAST<Entity *>((entity)))->Entity::GetSprite();
|
|
pAVar10 = GHIDRA_CAST<AnimationState *>(Config)::GetPillEffects();
|
|
local_160.y = (float)(GHIDRA_CAST<AnimationState *>((pAVar10)))->AnimationState::GetLayerFrame(GHIDRA_INT(local_130));
|
|
if (((void *)local_160.y != (void *)0x0) &&
|
|
(*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(local_160.y) + 0x2c)) != '\0')) {
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((&local_13c)))->Vector::Vector(33.0,37.0);
|
|
local_100.y = 96.0;
|
|
(GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__div(GHIDRA_CAST<Vector *>(local_178),&local_100.y);
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((&local_128)))->Vector::Vector(31.0,35.0);
|
|
local_100.y = 96.0;
|
|
(GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__div(&local_120,&local_100.y);
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((&local_180)))->Vector::Vector(62.0,39.0);
|
|
local_100.y = 96.0;
|
|
(GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__div(&local_110,&local_100.y);
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((&local_170)))->Vector::Vector(39.0,35.0);
|
|
local_100.y = 96.0;
|
|
(GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__div(&local_188,&local_100.y);
|
|
local_100.y = (float)(uVar16 * 0x10 + *GHIDRA_CAST<int *>((local_12c->_animDefaultName)._buf));
|
|
lightSprite = GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<Entity *>((entity)))->Entity)::GetSprite();
|
|
sprite = GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Entity *>((entity)))->Entity)::GetSprite();
|
|
layer = (GHIDRA_CAST<Sprite *>((sprite)))->Sprite::GetLayer(GHIDRA_CAST<byte *>(local_130));
|
|
fVar23 = local_160.y;
|
|
fStack_26c = 1.1820939e-38;
|
|
render_build_sprite_quad
|
|
(&flameQuad,&g_vectorZero,(void *)local_160.y,layer,&g_vectorZero,
|
|
&g_vectorZero,lightSprite);
|
|
if (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(fVar23) + 0x14)) == 864.0) {
|
|
lightSprite = GHIDRA_CAST<ANM2 *>(&local_110);
|
|
}
|
|
else {
|
|
lightSprite = GHIDRA_CAST<ANM2 *>(&local_120);
|
|
if (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(fVar23) + 0x10)) < 576.0) {
|
|
lightSprite = GHIDRA_CAST<ANM2 *>(local_178);
|
|
}
|
|
}
|
|
local_150.y = (float)lightSprite;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((&flameDelta1)))->Vector::__sub(&local_13c,&flameQuad);
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__mul(&local_128,GHIDRA_CAST<float *>(lightSprite));
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((&flameQuad)))->Vector::__add(&local_180,pVVar5);
|
|
pVVar17 = (GHIDRA_CAST<Vector *>((flameDelta2)))->Vector::__sub(&local_170,&flameQuad);
|
|
pVVar17 = (GHIDRA_CAST<Vector *>((pVVar17)))->Vector::__mul(&local_100,
|
|
GHIDRA_CAST<float *>((GHIDRA_INT((GHIDRA_CAST<std_string *>(local_150.y))->_buf) + 4)));
|
|
(GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(&local_194,pVVar17);
|
|
pRVar18 = room;
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&tmpColor))))->Color::Color(0.8,0.2,1.0,1.0);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&pRVar18->_lightSprite))))->Sprite::SetColor(color_07);
|
|
local_100.y = 0.6;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((&g_vectorOne)))->Vector::__mul(&local_160,&local_100.y);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&pRVar18->_lightSprite))))->Sprite::SetScale(pVVar5);
|
|
bVar3 = 1;
|
|
pVVar5 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Position(&local_1b8);
|
|
pVVar5 = Isaac::GetRenderPosition(&local_13c,pVVar5,bVar3);
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(&local_128,&renderOffsetLocal);
|
|
uVar16 = (GHIDRA_CAST<RNG *>((&flickerRng)))->RNG::Next();
|
|
pVVar17 = RandomVector(&local_180,uVar16);
|
|
local_100.y = (GHIDRA_CAST<RNG *>((&flickerRng)))->RNG::RandomFloat();
|
|
pVVar17 = (GHIDRA_CAST<Vector *>((pVVar17)))->Vector::__mul(&local_170,&local_100.y);
|
|
local_160.y = 0.75;
|
|
pVVar13 = (GHIDRA_CAST<Vector *>((pVVar17)))->Vector::__mul(&local_1b0,&local_160.y);
|
|
pVVar17 = &local_150;
|
|
goto LAB_00809757;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
uVar16 = uVar16 + 1;
|
|
local_150.y = (float)&(GHIDRA_CAST<std_string *>(local_150.y))->_size;
|
|
} while (uVar16 < GHIDRA_UINT(*GHIDRA_CAST<int *>((GHIDRA_INT((local_12c->_animDefaultName)._buf) + 4))));
|
|
}
|
|
}
|
|
break;
|
|
case 0x3c5:
|
|
if (this->_roomList[0x28].Flags == 0x2e) {
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&tmpColor))))->Color::Reset();
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&tmpColor))))->Color::SetTint(1.0,0.4,0.0,0.5);
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>((this->_roomList[0x9a]._doors + 2)))))->Color::operator_assign(&tmpColor);
|
|
local_188.y = (float)(this->_roomList[0x99]._doors + 6);
|
|
fVar23 = g_vectorOne.y * 0.6;
|
|
this->_roomList[0x9a].AllowedDoors = GHIDRA_INT((g_vectorOne.x * 0.6));
|
|
this->_roomList[0x9a]._doors[0] = GHIDRA_INT(fVar23);
|
|
if (this->_roomList[0x99].SavedGridEntities._begin != (void *)0x0) {
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(&this->_roomList[0x99].BossDeathSeed))))->AnimationState::SetFrameFloat(1.0);
|
|
}
|
|
local_110.y = ((GHIDRA_CAST<Entity_Player *>(entity))->_pos).y - 12.0;
|
|
local_110.x = ((GHIDRA_CAST<Entity_Player *>(entity))->_pos).x + 0.0;
|
|
pVVar5 = Isaac::GetRenderPosition(&local_13c,&local_110,1);
|
|
local_100.y = renderOffsetLocal.x + pVVar5->x;
|
|
local_160.y = renderOffsetLocal.y + pVVar5->y;
|
|
uVar16 = (GHIDRA_CAST<RNG *>((&flickerRng)))->RNG::Next();
|
|
pVVar5 = RandomVector(&local_128,uVar16);
|
|
(GHIDRA_CAST<RNG *>((&flickerRng)))->RNG::Next();
|
|
fVar23 = (float)((double)flickerRng._seed +
|
|
__uint_to_double_fixup[-(flickerRng._seed >> 0x1f)]) * 2.3283062e-10;
|
|
fVar23 = fVar23 + fVar23;
|
|
local_120.y = pVVar5->y * fVar23 + local_160.y;
|
|
local_120.x = fVar23 * pVVar5->x + local_100.y;
|
|
goto LAB_00809c03;
|
|
}
|
|
break;
|
|
case 1000:
|
|
switch((GHIDRA_CAST<Entity_Player *>(entity))->_variant) {
|
|
case 1:
|
|
iVar20 = g_game->_frameCount - (GHIDRA_CAST<Entity_Player *>(entity))->_spawnFrame;
|
|
if (iVar20 < 7) {
|
|
local_100.y = (float)iVar20 / 6.0;
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_c8))))->Color::Reset();
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_c8))))->Color::SetTint(1.0,1.0,1.0,1.0 - local_100.y * local_100.y);
|
|
local_a8 = GHIDRA_CAST<ANM2 *>(0x3e48c8ca);
|
|
local_a4 = (void *)0x3e48c8ca;
|
|
local_a0 = 0.19607845;
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_c8))))->Color::__mul(&((GHIDRA_CAST<Entity_Player *>(entity))->_sprite)._color);
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&tmpColor))))->Color::operator_assign(GHIDRA_CAST<ColorMod *>(local_c8));
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>((this->_roomList[0x9a]._doors + 2)))))->Color::operator_assign(&tmpColor);
|
|
local_100.y = (float)(this->_roomList[0x99]._doors + 6);
|
|
if (this->_roomList[0x99].SavedGridEntities._begin != (void *)0x0) {
|
|
AnimationState::SetFrameFloat
|
|
(GHIDRA_CAST<AnimationState *>(&this->_roomList[0x99].BossDeathSeed),
|
|
(float)(1.5 < ((GHIDRA_CAST<Entity_Player *>(entity))->_sprite)._scale.x));
|
|
}
|
|
fVar23 = ((GHIDRA_CAST<Entity_Player *>(entity))->_sprite)._scale.y;
|
|
this->_roomList[0x9a].AllowedDoors =
|
|
GHIDRA_INT((((GHIDRA_CAST<Entity_Player *>(entity))->_sprite)._scale.x * 1.5));
|
|
this->_roomList[0x9a]._doors[0] = GHIDRA_INT((fVar23 * 1.5));
|
|
local_110.y = ((GHIDRA_CAST<Entity_Player *>(entity))->_pos).y;
|
|
local_110.x = ((GHIDRA_CAST<Entity_Player *>(entity))->_pos).x;
|
|
pVVar5 = Isaac::GetRenderPosition(&local_13c,&local_110,1);
|
|
local_120.y = renderOffsetLocal.y + pVVar5->y;
|
|
local_120.x = renderOffsetLocal.x + pVVar5->x;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(local_100.y))))->ANM2::Render(&local_120,&g_vectorZero,&g_vectorZero);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(local_100.y))))->Sprite::SetFrame_1(0);
|
|
}
|
|
break;
|
|
case 10:
|
|
sprite = GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Entity *>((entity)))->Entity)::GetSprite();
|
|
pCVar8 = GHIDRA_CAST<Color *>((GHIDRA_CAST<Sprite *>((sprite)))->Sprite)::Color();
|
|
(GHIDRA_CAST<Color *>((pCVar8)))->Color::A();
|
|
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Color *>(()))->Color)::Color();
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((this->_roomList[0x99]._doors + 6)))))->Sprite::SetColor(color);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((this->_roomList[0x99]._doors + 6)))))->Sprite::SetScale(&g_vectorOne);
|
|
pVVar17 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Position(&local_13c);
|
|
pVVar5 = &local_128;
|
|
goto LAB_00808e0d;
|
|
case 0x16:
|
|
case 0x17:
|
|
lightSprite = GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<Room *>((GHIDRA_CAST<Room *>(this))))->Room)::GetLightingAlpha();
|
|
local_100.y = (float)lightSprite;
|
|
if (0.5 < (float)lightSprite) {
|
|
pVVar5 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Position(&local_13c);
|
|
local_130 = GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<Room *>((GHIDRA_CAST<Room *>(this))))->Room)::GetGridIndex(pVVar5);
|
|
local_12c = GHIDRA_CAST<ANM2 *>(&this->_roomList[0x9f].ShopItemIdx);
|
|
std::set<int>::find();
|
|
std::iterator_copy(local_12c,&local_160.y);
|
|
cVar2 = FUN_00557bb0();
|
|
if (cVar2 != '\0') {
|
|
pfVar4 = GHIDRA_CAST<float *>((GHIDRA_CAST<Entity *>((entity)))->Entity)::SpriteScale();
|
|
FUN_00417340();
|
|
local_100.y = (float)lightSprite * *pfVar4;
|
|
pCVar8 = GHIDRA_CAST<Color *>((GHIDRA_CAST<Entity *>((entity)))->Entity)::GetColor();
|
|
local_150.y = (GHIDRA_CAST<Color *>((pCVar8)))->Color::A();
|
|
iVar20 = (GHIDRA_CAST<Entity *>((entity)))->Entity::FrameCount();
|
|
if (iVar20 < 10) {
|
|
(GHIDRA_CAST<Entity *>((entity)))->Entity::FrameCount();
|
|
}
|
|
lightSprite = &room->_lightSprite;
|
|
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Color *>(()))->Color)::Color();
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(lightSprite))))->Sprite::SetColor(color);
|
|
local_100.y = local_100.y * 0.02;
|
|
local_160.y = 0.5;
|
|
pfVar4 = GHIDRA_CAST<float *>(std)::max<float>();
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((&g_vectorOne)))->Vector::__mul(&local_13c,pfVar4);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(lightSprite))))->Sprite::SetScale(pVVar5);
|
|
bVar3 = 1;
|
|
pVVar5 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Position(&local_128);
|
|
pVVar5 = Isaac::GetRenderPosition(&local_13c,pVVar5,bVar3);
|
|
pVVar13 = &g_vectorZero;
|
|
pVVar17 = &g_vectorZero;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(&local_110,&renderOffsetLocal);
|
|
(GHIDRA_CAST<ANM2 *>((lightSprite)))->ANM2::Render(pVVar5,pVVar17,pVVar13);
|
|
std::set<int>::insert();
|
|
}
|
|
}
|
|
break;
|
|
case 0x1e:
|
|
case 0x99:
|
|
temp_5ff20d4b15 = (GHIDRA_CAST<Entity_Player *>(entity))->_spawnerEntity;
|
|
if ((temp_5ff20d4b15 != (EntityPtr)0x0) &&
|
|
(((1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(temp_5ff20d4b15) + 0x28)) == 1))
|
|
|| (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(temp_5ff20d4b15) + 0x28)) - 10U < 0x3de)))) {
|
|
bVar3 = is_local_player_owned((void *)temp_5ff20d4b15);
|
|
if (bVar3 == 0) break;
|
|
}
|
|
pvVar11 = (GHIDRA_CAST<AnimationState *>((&((GHIDRA_CAST<Entity_Player *>(entity))->_sprite)._animState)))->AnimationState::GetLayerFrame(0);
|
|
if ((pvVar11 != (void *)0x0) && (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar11) + 0x2c)) != '\0')) {
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&tmpColor))))->Color::Reset();
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&tmpColor))))->Color::SetTint(1.0,0.0,0.0,1.0);
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>((this->_roomList[0x9a]._doors + 2)))))->Color::operator_assign(&tmpColor);
|
|
fVar23 = ((GHIDRA_CAST<Entity_Player *>(entity))->_sprite)._scale.y;
|
|
this->_roomList[0x9a].AllowedDoors =
|
|
GHIDRA_INT((((GHIDRA_CAST<Entity_Player *>(entity))->_sprite)._scale.x * 0.5));
|
|
this->_roomList[0x9a]._doors[0] = GHIDRA_INT((fVar23 * 0.5));
|
|
if (this->_roomList[0x99].SavedGridEntities._begin != (void *)0x0) {
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(&this->_roomList[0x99].BossDeathSeed))))->AnimationState::SetFrameFloat(1.0);
|
|
}
|
|
lightSprite = GHIDRA_CAST<ANM2 *>((this->_roomList[0x99]._doors + 6));
|
|
layer = (GHIDRA_CAST<ANM2 *>((lightSprite)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x0));
|
|
layer->_blendMode[0] = DAT_00c35b58;
|
|
layer->_blendMode[1] = DAT_00c35b5c;
|
|
layer->_blendMode[2] = DAT_00c35b60;
|
|
layer->_blendMode[3] = DAT_00c35b64;
|
|
layer->_blendMode[4] = DAT_00c35b68;
|
|
local_110.y = ((GHIDRA_CAST<Entity_Player *>(entity))->_pos).y;
|
|
local_110.x = ((GHIDRA_CAST<Entity_Player *>(entity))->_pos).x;
|
|
pVVar5 = Isaac::GetRenderPosition(&local_13c,&local_110,1);
|
|
local_120.y = renderOffsetLocal.y + pVVar5->y;
|
|
local_120.x = renderOffsetLocal.x + pVVar5->x;
|
|
(GHIDRA_CAST<ANM2 *>((lightSprite)))->ANM2::Render(&local_120,&g_vectorZero,&g_vectorZero);
|
|
layer = (GHIDRA_CAST<ANM2 *>((lightSprite)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x0));
|
|
layer->_blendMode[0] = DAT_00c354ac;
|
|
layer->_blendMode[1] = DAT_00c354b0;
|
|
layer->_blendMode[2] = DAT_00c354b4;
|
|
layer->_blendMode[3] = DAT_00c354b8;
|
|
layer->_blendMode[4] = DAT_00c354bc;
|
|
goto LAB_00809c21;
|
|
}
|
|
break;
|
|
case 0x27:
|
|
iVar20 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Parent();
|
|
if (iVar20 == 0) {
|
|
(GHIDRA_CAST<Entity *>((entity)))->Entity::GetSprite();
|
|
pAVar10 = GHIDRA_CAST<AnimationState *>(Config)::GetPillEffects();
|
|
pvVar11 = (GHIDRA_CAST<AnimationState *>((pAVar10)))->AnimationState::GetLayerFrame(0);
|
|
if (pvVar11 == (void *)0x0) break;
|
|
pCVar8 = GHIDRA_CAST<Color *>((GHIDRA_INT(pvVar11) + 0x30));
|
|
local_100.y = (GHIDRA_CAST<Color *>((pCVar8)))->Color::A();
|
|
local_160.y = (GHIDRA_CAST<Color *>((pCVar8)))->Color::B();
|
|
fVar21 = (float10)Color::G();
|
|
local_188.y = (float)fVar21;
|
|
local_194.y = (GHIDRA_CAST<Color *>((pCVar8)))->Color::R();
|
|
lightSprite = &room->_lightSprite;
|
|
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Color *>(()))->Color)::Color();
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(lightSprite))))->Sprite::SetColor(color);
|
|
local_100.y = 1.5;
|
|
LAB_008092a3:
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((&g_vectorOne)))->Vector::__mul(&local_13c,&local_100.y);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(lightSprite))))->Sprite::SetScale(pVVar5);
|
|
goto LAB_008092c5;
|
|
}
|
|
break;
|
|
case 0x33:
|
|
case 0x34:
|
|
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Color *>(()))->Color)::Color();
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((this->_roomList[0x99]._doors + 6)))))->Sprite::SetColor(color);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((this->_roomList[0x99]._doors + 6)))))->Sprite::SetScale(&g_vectorOne);
|
|
pVVar17 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Position(&local_13c);
|
|
pVVar5 = &local_128;
|
|
LAB_00808e0d:
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::Vector(0.0,-15.0);
|
|
bVar3 = 1;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar17)))->Vector::__add(&local_110,pVVar5);
|
|
pVVar5 = Isaac::GetRenderPosition(&local_120,pVVar5,bVar3);
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(GHIDRA_CAST<Vector *>(local_178),&renderOffsetLocal);
|
|
uVar16 = (GHIDRA_CAST<RNG *>((&flickerRng)))->RNG::Next();
|
|
pVVar17 = RandomVector(&local_180,uVar16);
|
|
fVar23 = (GHIDRA_CAST<RNG *>((&flickerRng)))->RNG::RandomFloat();
|
|
local_100.y = fVar23 + fVar23;
|
|
LAB_0080972b:
|
|
pVVar13 = (GHIDRA_CAST<Vector *>((pVVar17)))->Vector::__mul(&local_170,&local_100.y);
|
|
pVVar17 = &local_160;
|
|
LAB_00809757:
|
|
bottomrightclamp = &g_vectorZero;
|
|
pVVar12 = &g_vectorZero;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(pVVar17,pVVar13);
|
|
pRVar18 = room;
|
|
(GHIDRA_CAST<ANM2 *>((&room->_lightSprite)))->ANM2::Render(pVVar5,pVVar12,bottomrightclamp);
|
|
goto LAB_00807b3d;
|
|
case 0x41:
|
|
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Entity *>((entity)))->Entity)::SplatColor();
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&tmpColor))))->Color::operator_assign(color);
|
|
pfVar4 = GHIDRA_CAST<float *>((GHIDRA_CAST<Entity *>((entity)))->Entity)::SpriteScale();
|
|
(GHIDRA_CAST<Font *>((GHIDRA_CAST<Font *>(&tmpColor))))->Font::SetLineHeightModifier(*pfVar4);
|
|
color = &tmpColor;
|
|
goto LAB_0080a338;
|
|
case 0x46:
|
|
local_100.y = 1.0;
|
|
(GHIDRA_CAST<Entity *>((entity)))->Entity::IsDead();
|
|
(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(lightEntity))))->Entity)::GetColor();
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(entityColor))))->Color::operator_assign(color);
|
|
color = GHIDRA_CAST<ColorMod *>(FUN_004072e0());
|
|
lightSprite = &room->_lightSprite;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(lightSprite))))->Sprite::SetColor(color);
|
|
local_100.y = 0.3;
|
|
pVVar5 = &g_vectorOne;
|
|
LAB_0080a5c3:
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__mul(&local_13c,&local_100.y);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(lightSprite))))->Sprite::SetScale(pVVar5);
|
|
entity = GHIDRA_CAST<Entity *>(lightEntity);
|
|
LAB_008092c5:
|
|
bVar3 = 1;
|
|
pVVar5 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Position(&local_128);
|
|
pVVar5 = Isaac::GetRenderPosition(&local_13c,pVVar5,bVar3);
|
|
pVVar13 = &g_vectorZero;
|
|
pVVar17 = &g_vectorZero;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(&local_110,&renderOffsetLocal);
|
|
goto LAB_00807b32;
|
|
case 0x47:
|
|
case 0x6e:
|
|
cVar2 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Visible();
|
|
if (cVar2 != '\0') {
|
|
local_100.y = (float)(this->_roomList[0x99]._doors + 6);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(local_100.y))))->Sprite::SetFrame_1(1);
|
|
(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(lightEntity))))->Entity)::GetColor();
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(entityColor))))->Color::operator_assign(color);
|
|
color = GHIDRA_CAST<ColorMod *>(FUN_004072e0());
|
|
lightSprite = GHIDRA_CAST<ANM2 *>(local_100.y);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(local_100.y))))->Sprite::SetColor(color);
|
|
pEVar1 = lightEntity;
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(lightEntity))))->Entity::GetSprite();
|
|
pAVar10 = GHIDRA_CAST<AnimationState *>(Config)::GetPillEffects();
|
|
pvVar11 = (GHIDRA_CAST<AnimationState *>((pAVar10)))->AnimationState::GetLayerFrame(0);
|
|
if (pvVar11 == (void *)0x0) {
|
|
local_160.y = 1.0;
|
|
}
|
|
else {
|
|
local_160.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar11) + 0x18));
|
|
}
|
|
pfVar4 = GHIDRA_CAST<float *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar1))))->Entity)::SpriteScale();
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((&g_vectorOne)))->Vector::__mul(&local_13c,pfVar4);
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__mul(&local_128,&local_160.y);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(lightSprite))))->Sprite::SetScale(pVVar5);
|
|
pVVar5 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar1))))->Entity::Position(&local_110);
|
|
pVVar17 = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(lightEntity))))->Entity)::PositionOffset();
|
|
bVar3 = 1;
|
|
pVVar17 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(&local_13c,pVVar17);
|
|
pVVar5 = &local_128;
|
|
goto LAB_0080aace;
|
|
}
|
|
break;
|
|
case 0x5d:
|
|
(GHIDRA_CAST<Entity *>((entity)))->Entity::GetSprite();
|
|
pAVar10 = GHIDRA_CAST<AnimationState *>(Config)::GetPillEffects();
|
|
pvVar11 = (GHIDRA_CAST<AnimationState *>((pAVar10)))->AnimationState::GetLayerFrame(0);
|
|
if (pvVar11 != (void *)0x0) {
|
|
fVar21 = (float10)Color::RO();
|
|
local_100.y = (float)(fVar21 + (float10)1.0);
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&tmpColor))))->Color::Color(1.0,0.1,0.1,local_100.y);
|
|
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(lightEntity))))->Entity)::GetColor();
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(entityColor))))->Color::operator_assign(color);
|
|
color = GHIDRA_CAST<ColorMod *>(FUN_004072e0());
|
|
lightSprite = &room->_lightSprite;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(lightSprite))))->Sprite::SetColor(color);
|
|
pVVar5 = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(lightEntity))))->Entity)::SpriteScale();
|
|
local_100.y = 4.0;
|
|
goto LAB_0080a5c3;
|
|
}
|
|
break;
|
|
case 0x68:
|
|
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(lightEntity))))->Entity)::GetColor();
|
|
LAB_0080a338:
|
|
lightSprite = GHIDRA_CAST<ANM2 *>((this->_roomList[0x99]._doors + 6));
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(lightSprite))))->Sprite::SetColor(color);
|
|
local_100.y = 0.5;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((&g_vectorOne)))->Vector::__mul(&local_13c,&local_100.y);
|
|
pfVar4 = GHIDRA_CAST<float *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(lightEntity))))->Entity)::SpriteScale();
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__mul(&local_128,pfVar4);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(lightSprite))))->Sprite::SetScale(pVVar5);
|
|
pVVar5 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(lightEntity))))->Entity::Position(&local_110);
|
|
pVVar17 = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(lightEntity))))->Entity)::PositionOffset();
|
|
bVar3 = 1;
|
|
pVVar17 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(&local_13c,pVVar17);
|
|
pVVar5 = &local_128;
|
|
LAB_0080a3bc:
|
|
pVVar5 = Isaac::GetRenderPosition(pVVar5,pVVar17,bVar3);
|
|
pVVar13 = &g_vectorZero;
|
|
pVVar17 = &g_vectorZero;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(&local_120,&renderOffsetLocal);
|
|
goto LAB_00807b32;
|
|
case 0x6f:
|
|
iVar20 = (GHIDRA_CAST<Entity *>((entity)))->Entity::SubType();
|
|
if (iVar20 != 1) break;
|
|
(GHIDRA_CAST<Entity *>((entity)))->Entity::GetSprite();
|
|
_empty_check_0x34();
|
|
local_100.y = (float)lightSprite;
|
|
(GHIDRA_CAST<Entity *>((entity)))->Entity::GetSprite();
|
|
pAVar10 = GHIDRA_CAST<AnimationState *>(Config)::GetPillEffects();
|
|
iVar20 = (GHIDRA_CAST<AnimationState *>((pAVar10)))->AnimationState::GetAnimationLength();
|
|
local_100.y = 1.0 - local_100.y / (float)iVar20;
|
|
pKVar15 = (GHIDRA_CAST<KColor *>((GHIDRA_CAST<KColor *>((local_c8 + 0x18)))))->KColor::KColor(0.7,0.0,0.0,1.0);
|
|
sprite = GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Entity *>((entity)))->Entity)::GetSprite();
|
|
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Sprite *>((sprite)))->Sprite)::Color();
|
|
Color::apply_to_kcolor(&local_1a8,color,pKVar15);
|
|
lightSprite = &room->_lightSprite;
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&tmpColor))))->Color::Color(local_1a8._red,local_1a8._green,local_1a8._blue,
|
|
local_1a8._alpha * local_100.y);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(lightSprite))))->Sprite::SetColor(color_03);
|
|
sprite = GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(lightEntity))))->Entity)::GetSprite();
|
|
pVVar5 = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Sprite *>((sprite)))->Sprite)::Scale();
|
|
local_100.y = 0.5;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__mul(&local_13c,&local_100.y);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(lightSprite))))->Sprite::SetScale(pVVar5);
|
|
pVVar5 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(lightEntity))))->Entity::Position(&local_128);
|
|
pVVar17 = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(lightEntity))))->Entity)::PositionOffset();
|
|
bVar3 = 1;
|
|
pVVar17 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(&local_13c,pVVar17);
|
|
pVVar5 = &local_110;
|
|
goto LAB_0080a3bc;
|
|
case 0x70:
|
|
(GHIDRA_CAST<Entity *>((entity)))->Entity::GetSprite();
|
|
pAVar10 = GHIDRA_CAST<AnimationState *>(Config)::GetPillEffects();
|
|
pvVar11 = (GHIDRA_CAST<AnimationState *>((pAVar10)))->AnimationState::GetLayerFrame(0);
|
|
fVar23 = (GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>((GHIDRA_INT(pvVar11) + 0x30)))))->Color::A();
|
|
local_100.y = fVar23 * 6.4;
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&tmpColor))))->Color::Color(0.4,0.7,1.0,local_100.y);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((this->_roomList[0x99]._doors + 6)))))->Sprite::SetColor(color_02);
|
|
pVVar5 = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Entity *>((entity)))->Entity)::SpriteScale();
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((this->_roomList[0x99]._doors + 6)))))->Sprite::SetScale(pVVar5);
|
|
pVVar5 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Position(&local_13c);
|
|
pVVar17 = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Entity *>((entity)))->Entity)::PositionOffset();
|
|
bVar3 = 1;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(&local_128,pVVar17);
|
|
pVVar5 = Isaac::GetRenderPosition(&local_110,pVVar5,bVar3);
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(&local_120,&renderOffsetLocal);
|
|
uVar16 = (GHIDRA_CAST<RNG *>((&flickerRng)))->RNG::Next();
|
|
pVVar17 = RandomVector(GHIDRA_CAST<Vector *>(local_178),uVar16);
|
|
fVar23 = (GHIDRA_CAST<RNG *>((&flickerRng)))->RNG::RandomFloat();
|
|
local_100.y = fVar23 + fVar23;
|
|
pVVar13 = (GHIDRA_CAST<Vector *>((pVVar17)))->Vector::__mul(&local_180,&local_100.y);
|
|
pVVar17 = &local_170;
|
|
goto LAB_00809757;
|
|
case 0x71:
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((this->_roomList[0x99]._doors + 6)))))->Sprite::SetFrame_1(1);
|
|
(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(lightEntity))))->Entity)::GetColor();
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(entityColor))))->Color::operator_assign(color);
|
|
color = GHIDRA_CAST<ColorMod *>(FUN_004072e0());
|
|
lightSprite = &room->_lightSprite;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(lightSprite))))->Sprite::SetColor(color);
|
|
pfVar4 = GHIDRA_CAST<float *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(lightEntity))))->Entity)::SpriteScale();
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((&g_vectorOne)))->Vector::__mul(&local_13c,pfVar4);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(lightSprite))))->Sprite::SetScale(pVVar5);
|
|
pVVar5 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(lightEntity))))->Entity::Position(&local_128);
|
|
pVVar17 = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(lightEntity))))->Entity)::PositionOffset();
|
|
bVar3 = 1;
|
|
pVVar17 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(&local_13c,pVVar17);
|
|
pVVar5 = &local_110;
|
|
LAB_0080aace:
|
|
pVVar5 = Isaac::GetRenderPosition(pVVar5,pVVar17,bVar3);
|
|
pVVar13 = &g_vectorZero;
|
|
pVVar17 = &g_vectorZero;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(&local_120,&renderOffsetLocal);
|
|
(GHIDRA_CAST<ANM2 *>((lightSprite)))->ANM2::Render(pVVar5,pVVar17,pVVar13);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(lightSprite))))->Sprite::SetFrame_1(0);
|
|
break;
|
|
case 0x73:
|
|
local_100.y = (GHIDRA_CAST<Room *>((GHIDRA_CAST<Room *>(this))))->Room::GetLightingAlpha();
|
|
if (0.5 < local_100.y) {
|
|
fVar23 = (GHIDRA_CAST<Room *>((GHIDRA_CAST<Room *>(this))))->Room::GetLightingAlpha();
|
|
local_100.y = fVar23 - 0.5;
|
|
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Color *>(()))->Color)::Color();
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((this->_roomList[0x99]._doors + 6)))))->Sprite::SetColor(color);
|
|
local_100.y = 4.0;
|
|
LAB_0080ae36:
|
|
lightSprite = GHIDRA_CAST<ANM2 *>((this->_roomList[0x99]._doors + 6));
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((&g_vectorOne)))->Vector::__mul(&local_13c,&local_100.y);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(lightSprite))))->Sprite::SetScale(pVVar5);
|
|
pVVar5 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(lightEntity))))->Entity::Position(&local_128);
|
|
pVVar17 = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(lightEntity))))->Entity)::PositionOffset();
|
|
bVar3 = 1;
|
|
pVVar17 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(&local_13c,pVVar17);
|
|
pVVar5 = &local_110;
|
|
goto LAB_0080a3bc;
|
|
}
|
|
break;
|
|
case 0x79:
|
|
cVar2 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Visible();
|
|
if (cVar2 != '\0') {
|
|
fVar21 = (float10)(GHIDRA_CAST<Entity_Effect *>((GHIDRA_CAST<Entity_Effect *>(entity))))->Entity_Effect::Scale();
|
|
local_160.y = (float)fVar21;
|
|
local_188.y = (float)(GHIDRA_CAST<Entity *>((entity)))->Entity::GetSprite();
|
|
pVVar5 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Position(&local_13c);
|
|
pVVar17 = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Entity *>((entity)))->Entity)::PositionOffset();
|
|
bVar3 = 1;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(&local_128,pVVar17);
|
|
pVVar5 = Isaac::GetRenderPosition(&local_110,pVVar5,bVar3);
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(&local_120,&renderOffsetLocal);
|
|
uVar16 = (GHIDRA_CAST<RNG *>((&flickerRng)))->RNG::Next();
|
|
pVVar17 = RandomVector(GHIDRA_CAST<Vector *>(local_178),uVar16);
|
|
local_100.y = (GHIDRA_CAST<RNG *>((&flickerRng)))->RNG::RandomFloat();
|
|
pVVar17 = (GHIDRA_CAST<Vector *>((pVVar17)))->Vector::__mul(&local_180,&local_100.y);
|
|
pVVar17 = (GHIDRA_CAST<Vector *>((pVVar17)))->Vector::__mul(&local_170,&local_160.y);
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(&local_194,pVVar17);
|
|
pVVar13 = &g_vectorZero;
|
|
pVVar17 = &g_vectorZero;
|
|
lightSprite = GHIDRA_CAST<ANM2 *>(local_188.y);
|
|
goto LAB_00807b32;
|
|
}
|
|
break;
|
|
case 0x7e:
|
|
cVar2 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Visible();
|
|
if (cVar2 != '\0') {
|
|
local_100.y = (float)(this->_roomList[0x99]._doors + 6);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(local_100.y))))->Sprite::SetFrame_1(1);
|
|
(GHIDRA_CAST<Color *>(()))->Color::Color();
|
|
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(lightEntity))))->Entity)::GetColor();
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(entityColor))))->Color::operator_assign(color);
|
|
color = GHIDRA_CAST<ColorMod *>(FUN_004072e0());
|
|
sprite = GHIDRA_CAST<Sprite *>(local_100.y);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(local_100.y))))->Sprite::SetColor(color);
|
|
pEVar1 = lightEntity;
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(lightEntity))))->Entity::GetSprite();
|
|
local_150.y = (float)Config::GetPillEffects();
|
|
bVar3 = (GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(local_150.y))))->AnimationState::IsLoopingAnimation();
|
|
if (bVar3 == 0) {
|
|
FUN_00407370();
|
|
local_100.y = (float)lightSprite;
|
|
iVar20 = (GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(local_150.y))))->AnimationState::GetAnimationLength();
|
|
local_160.y = 1.0 - local_100.y / (float)iVar20;
|
|
}
|
|
else {
|
|
local_160.y = 1.0;
|
|
}
|
|
pfVar4 = GHIDRA_CAST<float *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar1))))->Entity)::SpriteScale();
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((&g_vectorOne)))->Vector::__mul(&local_13c,pfVar4);
|
|
local_100.y = 0.2;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__mul(&local_128,&local_100.y);
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__mul(&local_110,&local_160.y);
|
|
(GHIDRA_CAST<Sprite *>((sprite)))->Sprite::SetScale(pVVar5);
|
|
pVVar5 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar1))))->Entity::Position(&local_120);
|
|
pVVar17 = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(lightEntity))))->Entity)::PositionOffset();
|
|
bVar3 = 1;
|
|
pVVar17 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(&local_13c,pVVar17);
|
|
pVVar5 = &local_128;
|
|
LAB_0080a2c7:
|
|
pVVar17 = Isaac::GetRenderPosition(pVVar5,pVVar17,bVar3);
|
|
pVVar5 = &local_110;
|
|
LAB_0080a2e8:
|
|
pVVar12 = &g_vectorZero;
|
|
pVVar13 = &g_vectorZero;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar17)))->Vector::__add(pVVar5,&renderOffsetLocal);
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(sprite))))->ANM2::Render(pVVar5,pVVar13,pVVar12);
|
|
(GHIDRA_CAST<Sprite *>((sprite)))->Sprite::SetFrame_1(0);
|
|
}
|
|
break;
|
|
case 0x8d:
|
|
pVVar5 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Position(&local_13c);
|
|
local_130 = GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<Room *>((GHIDRA_CAST<Room *>(this))))->Room)::GetGridIndex(pVVar5);
|
|
local_12c = GHIDRA_CAST<ANM2 *>(&this->_roomList[0x9f].ShopItemIdx);
|
|
std::set<int>::find();
|
|
std::iterator_copy(local_12c,&local_160.y);
|
|
cVar2 = FUN_00557bb0();
|
|
if (cVar2 != '\0') {
|
|
pCVar8 = GHIDRA_CAST<Color *>((GHIDRA_CAST<Entity *>((entity)))->Entity)::GetColor();
|
|
local_150.y = (GHIDRA_CAST<Color *>((pCVar8)))->Color::A();
|
|
iVar20 = (GHIDRA_CAST<Entity *>((entity)))->Entity::FrameCount();
|
|
if (iVar20 < 10) {
|
|
iVar20 = (GHIDRA_CAST<Entity *>((entity)))->Entity::FrameCount();
|
|
local_150.y = ((float)iVar20 / 10.0) * local_150.y;
|
|
}
|
|
pEVar1 = lightEntity;
|
|
lightSprite = &room->_lightSprite;
|
|
sprite = GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(lightEntity))))->Entity)::GetSprite();
|
|
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Sprite *>((sprite)))->Sprite)::Color();
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(lightSprite))))->Sprite::SetColor(color);
|
|
pFVar7 = GHIDRA_CAST<Font *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(lightSprite))))->Sprite)::Color();
|
|
(GHIDRA_CAST<Font *>((pFVar7)))->Font::SetLineHeightModifier(local_150.y);
|
|
sprite = GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar1))))->Entity)::GetSprite();
|
|
pVVar5 = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Sprite *>((sprite)))->Sprite)::Scale();
|
|
local_100.y = 0.8;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__mul(&local_13c,&local_100.y);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(lightSprite))))->Sprite::SetScale(pVVar5);
|
|
pVVar5 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar1))))->Entity::Position(&local_128);
|
|
pVVar17 = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(lightEntity))))->Entity)::PositionOffset();
|
|
bVar3 = 1;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(&local_13c,pVVar17);
|
|
pVVar5 = Isaac::GetRenderPosition(&local_110,pVVar5,bVar3);
|
|
pVVar13 = &g_vectorZero;
|
|
pVVar17 = &g_vectorZero;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(&local_120,&renderOffsetLocal);
|
|
(GHIDRA_CAST<ANM2 *>((lightSprite)))->ANM2::Render(pVVar5,pVVar17,pVVar13);
|
|
std::set<int>::insert();
|
|
}
|
|
break;
|
|
case 0xaf:
|
|
iVar20 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Target();
|
|
if (iVar20 == 0) {
|
|
pVVar17 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Position(&local_120);
|
|
pVVar13 = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Entity *>((entity)))->Entity)::PositionOffset();
|
|
pVVar5 = GHIDRA_CAST<Vector *>(local_178);
|
|
}
|
|
else {
|
|
pEVar14 = GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(()))->Entity)::Target();
|
|
pVVar17 = (GHIDRA_CAST<Entity *>((pEVar14)))->Entity::Position(&local_13c);
|
|
pEVar14 = GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>((entity)))->Entity)::Target();
|
|
pVVar13 = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Entity *>((pEVar14)))->Entity)::PositionOffset();
|
|
pVVar5 = &local_128;
|
|
}
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar17)))->Vector::__add(pVVar5,pVVar13);
|
|
lightSprite = &room->_lightSprite;
|
|
local_110.x = pVVar5->x;
|
|
local_110.y = pVVar5->y;
|
|
sprite = GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Entity *>((entity)))->Entity)::GetSprite();
|
|
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Sprite *>((sprite)))->Sprite)::Color();
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(lightSprite))))->Sprite::SetColor(color);
|
|
sprite = GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Entity *>((entity)))->Entity)::GetSprite();
|
|
pVVar5 = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Sprite *>((sprite)))->Sprite)::Scale();
|
|
local_100.y = 0.6;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__mul(&local_13c,&local_100.y);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(lightSprite))))->Sprite::SetScale(pVVar5);
|
|
pVVar5 = Isaac::GetRenderPosition(&local_128,&local_110,1);
|
|
pVVar13 = &g_vectorZero;
|
|
pVVar17 = &g_vectorZero;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(&local_13c,&renderOffsetLocal);
|
|
LAB_00807b32:
|
|
(GHIDRA_CAST<ANM2 *>((lightSprite)))->ANM2::Render(pVVar5,pVVar17,pVVar13);
|
|
break;
|
|
case 0xb1:
|
|
iVar20 = (GHIDRA_CAST<Entity *>((entity)))->Entity::SubType();
|
|
if (iVar20 == 0) {
|
|
cVar2 = (GHIDRA_CAST<Entity *>((entity)))->Entity::Visible();
|
|
if (cVar2 != '\0') {
|
|
(GHIDRA_CAST<Entity *>((entity)))->Entity::GetSprite();
|
|
pAVar10 = GHIDRA_CAST<AnimationState *>(Config)::GetPillEffects();
|
|
local_100.y = (float)(GHIDRA_CAST<AnimationState *>((pAVar10)))->AnimationState::GetAnimationLength();
|
|
lightSprite = GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<Entity *>((entity)))->Entity)::GetSprite();
|
|
iVar20 = (GHIDRA_CAST<ANM2 *>((lightSprite)))->ANM2::GetFrame();
|
|
if (GHIDRA_INT(local_100.y) - iVar20 < 7) {
|
|
sprite = GHIDRA_CAST<Sprite *>((this->_roomList[0x99]._doors + 6));
|
|
local_100.y = (float)(GHIDRA_INT(local_100.y) - iVar20) / 6.0;
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(lightEntity))))->Entity::GetColor();
|
|
(GHIDRA_CAST<Color *>((1.0 - local_100.y * local_100.y)))->Color::Color(0x32,0x32,0x32);
|
|
color = GHIDRA_CAST<ColorMod *>(FUN_004072e0());
|
|
(GHIDRA_CAST<Sprite *>((sprite)))->Sprite::SetColor(color);
|
|
pEVar1 = lightEntity;
|
|
pfVar4 = GHIDRA_CAST<float *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(lightEntity))))->Entity)::SpriteScale();
|
|
(GHIDRA_CAST<Sprite *>((sprite)))->Sprite::SetFrame_1(GHIDRA_UINT((1.5 < *pfVar4)));
|
|
pVVar5 = GHIDRA_CAST<Vector *>((GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar1))))->Entity)::SpriteScale();
|
|
local_100.y = 1.5;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__mul(&local_13c,&local_100.y);
|
|
(GHIDRA_CAST<Sprite *>((sprite)))->Sprite::SetScale(pVVar5);
|
|
bVar3 = 1;
|
|
pVVar17 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pEVar1))))->Entity::Position(&local_128);
|
|
pVVar5 = &local_13c;
|
|
goto LAB_0080a2c7;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
switchD_00809dea_caseD_2:
|
|
pRVar18 = room;
|
|
LAB_00807b3d:
|
|
bVar3 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(lightEntity))))->Entity::IsEnemy();
|
|
if (((bVar3 != 0) && (cVar2 = FUN_004567d0(), cVar2 != '\0')) &&
|
|
(bVar3 = is_local_player_owned(lightEntity), bVar3 != 0)) {
|
|
lightSprite = &pRVar18->_lightSprite;
|
|
color = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Color *>(()))->Color)::Color();
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(lightSprite))))->Sprite::SetColor(color);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(lightSprite))))->Sprite::SetScale(&g_vectorOne);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(lightSprite))))->Sprite::SetFrame_1(1);
|
|
pVVar5 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(lightEntity))))->Entity::Position(&local_13c);
|
|
pVVar17 = (GHIDRA_CAST<Vector *>((&local_128)))->Vector::Vector(0.0,-15.0);
|
|
bVar3 = 1;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(&local_110,pVVar17);
|
|
pVVar5 = Isaac::GetRenderPosition(&local_120,pVVar5,bVar3);
|
|
pVVar13 = &g_vectorZero;
|
|
pVVar17 = &g_vectorZero;
|
|
pVVar5 = (GHIDRA_CAST<Vector *>((pVVar5)))->Vector::__add(GHIDRA_CAST<Vector *>(local_178),&renderOffsetLocal);
|
|
(GHIDRA_CAST<ANM2 *>((lightSprite)))->ANM2::Render(pVVar5,pVVar17,pVVar13);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(lightSprite))))->Sprite::SetFrame_1(0);
|
|
}
|
|
DAT_00c7977e = 0;
|
|
guard_check_icall();
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 0081df10
|
|
void Game::SetShockwaveParams(int shockwaveId, void *params)
|
|
{
|
|
if (1 < GHIDRA_UINT(shockwaveId)) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Shockwave id is too large!"));
|
|
}
|
|
this->_roomList[0x9c]._doors[shockwaveId * 7 + 0x1d] = *GHIDRA_CAST<int *>(params);
|
|
this->_roomList[0x9c]._doors[shockwaveId * 7 + 0x1e] = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(params) + 4));
|
|
this->_roomList[0x9c]._doors[shockwaveId * 7 + 0x1f] = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(params) + 8));
|
|
this->_roomList[0x9c]._doors[shockwaveId * 7 + 0x20] = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(params) + 0xc));
|
|
this->_roomList[0x9c]._doors[shockwaveId * 7 + 0x21] = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(params) + 0x10));
|
|
this->_roomList[0x9c]._doors[shockwaveId * 7 + 0x22] = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(params) + 0x14));
|
|
this->_roomList[0x9c]._doors[shockwaveId * 7 + 0x23] = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(params) + 0x18));
|
|
return;
|
|
}
|
|
|
|
// 0082c310
|
|
byte Game::LoadMinibossesXml(byte *path)
|
|
{
|
|
qword qVar1;
|
|
byte bVar2;
|
|
uint uVar3;
|
|
int *file;
|
|
int iVar4;
|
|
byte *text;
|
|
void *node;
|
|
byte *pbVar5;
|
|
byte *****pppppbVar6;
|
|
byte *pbVar7;
|
|
byte *pbVar8;
|
|
qword *allocatedBytes;
|
|
bool bVar9;
|
|
uint minibossId;
|
|
byte *****minibossName [4];
|
|
uint minibossNameSize;
|
|
uint minibossNameCapacity;
|
|
undefined1 xmlDocument [48];
|
|
undefined1 xmlMemoryPool [65564];
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
undefined4 *attribute;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b01d7b;
|
|
local_10 = ExceptionList;
|
|
uVar3 = __security_cookie ^ GHIDRA_UINT((xmlMemoryPool + 0x10028));
|
|
ExceptionList = &local_10;
|
|
file = (GHIDRA_CAST<FileSystem *>((&PTR_vftable_00c37a10)))->FileSystem::Open(path,GHIDRA_CAST<int *>(0x0));
|
|
if (file == GHIDRA_CAST<int *>(0x0)) {
|
|
bVar2 = 0;
|
|
}
|
|
else {
|
|
iVar4 = (**(code **)(*file + 4))(uVar3);
|
|
text = operator_new_tracked(iVar4 + 1);
|
|
(**(code **)(*file + 0x14))(text,1,iVar4);
|
|
text[iVar4] = 0;
|
|
(**(code **)*file)(1);
|
|
FUN_00413b90();
|
|
local_8 = 0;
|
|
iVar4 = 0x82c3b7;
|
|
pbVar8 = text;
|
|
(GHIDRA_CAST<rapidxml::xml_document *>((xmlDocument)))->rapidxml::xml_document::parse(text);
|
|
bVar2 = (byte)pbVar8;
|
|
node = (GHIDRA_CAST<xml_node *>((xmlDocument)))->xml_node::first_node(GHIDRA_CAST<byte *>("minibosses"),iVar4,bVar2);
|
|
for (node = (GHIDRA_CAST<xml_node *>((node)))->xml_node::first_node(GHIDRA_CAST<byte *>("miniboss"),iVar4,bVar2); node != (void *)0x0;
|
|
node = *(void **)(GHIDRA_CAST<char *>(node) + 0x2c)) {
|
|
minibossNameSize = 0;
|
|
minibossNameCapacity = 0xf;
|
|
minibossName[0] = GHIDRA_CAST<byte *****>(0x0);
|
|
uVar3 = local_8 >> 8;
|
|
local_8 = CONCAT31((int3)uVar3,1);
|
|
for (attribute = *GHIDRA_CAST<undefined4 **>((GHIDRA_CAST<char *>(node) + 0x20)); attribute != GHIDRA_CAST<undefined4 *>(0x0);
|
|
attribute = GHIDRA_CAST<undefined4 *>(attribute[6])) {
|
|
pbVar8 = GHIDRA_CAST<byte *>(*attribute);
|
|
pbVar7 = s_id;
|
|
pbVar5 = &g_xmlNullStr;
|
|
if (pbVar8 != GHIDRA_CAST<byte *>(0x0)) {
|
|
pbVar5 = pbVar8;
|
|
}
|
|
do {
|
|
bVar2 = *pbVar5;
|
|
bVar9 = bVar2 < *pbVar7;
|
|
if (bVar2 != *pbVar7) {
|
|
LAB_0082c456:
|
|
uVar3 = -GHIDRA_UINT(bVar9) | 1;
|
|
goto LAB_0082c45b;
|
|
}
|
|
if (bVar2 == 0) break;
|
|
bVar2 = pbVar5[1];
|
|
bVar9 = bVar2 < pbVar7[1];
|
|
if (bVar2 != pbVar7[1]) goto LAB_0082c456;
|
|
pbVar5 = pbVar5 + 2;
|
|
pbVar7 = pbVar7 + 2;
|
|
} while (bVar2 != 0);
|
|
uVar3 = 0;
|
|
LAB_0082c45b:
|
|
if (uVar3 == 0) {
|
|
pbVar8 = &g_xmlNullStr;
|
|
if (GHIDRA_CAST<byte *>(attribute[1]) != GHIDRA_CAST<byte *>(0x0)) {
|
|
pbVar8 = GHIDRA_CAST<byte *>(attribute[1]);
|
|
}
|
|
minibossId = atoi(GHIDRA_CAST<char *>(pbVar8));
|
|
}
|
|
else {
|
|
pbVar7 = s_name;
|
|
pbVar5 = &g_xmlNullStr;
|
|
if (pbVar8 != GHIDRA_CAST<byte *>(0x0)) {
|
|
pbVar5 = pbVar8;
|
|
}
|
|
do {
|
|
bVar2 = *pbVar5;
|
|
bVar9 = bVar2 < *pbVar7;
|
|
if (bVar2 != *pbVar7) {
|
|
LAB_0082c4b0:
|
|
uVar3 = -GHIDRA_UINT(bVar9) | 1;
|
|
goto LAB_0082c4b5;
|
|
}
|
|
if (bVar2 == 0) break;
|
|
bVar2 = pbVar5[1];
|
|
bVar9 = bVar2 < pbVar7[1];
|
|
if (bVar2 != pbVar7[1]) goto LAB_0082c4b0;
|
|
pbVar5 = pbVar5 + 2;
|
|
pbVar7 = pbVar7 + 2;
|
|
} while (bVar2 != 0);
|
|
uVar3 = 0;
|
|
LAB_0082c4b5:
|
|
if (uVar3 == 0) {
|
|
pbVar8 = &g_xmlNullStr;
|
|
if (GHIDRA_CAST<byte *>(attribute[1]) != GHIDRA_CAST<byte *>(0x0)) {
|
|
pbVar8 = GHIDRA_CAST<byte *>(attribute[1]);
|
|
}
|
|
pbVar5 = pbVar8;
|
|
do {
|
|
bVar2 = *pbVar5;
|
|
pbVar5 = pbVar5 + 1;
|
|
} while (bVar2 != 0);
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(minibossName))))->std::string::assign(pbVar8,GHIDRA_INT(pbVar5) - GHIDRA_INT((pbVar8 + 1)));
|
|
}
|
|
}
|
|
if (attribute[4] == 0) break;
|
|
}
|
|
if (minibossId < 0x10) {
|
|
this->_roomList[0x27]._doors[minibossId * 7 + 10] = minibossId;
|
|
file = this->_roomList[0x27]._doors + minibossId * 7 + 0xb;
|
|
if (GHIDRA_CAST<byte ******>(file) != minibossName) {
|
|
pppppbVar6 = GHIDRA_CAST<byte *****>(minibossName);
|
|
if (0xf < minibossNameCapacity) {
|
|
pppppbVar6 = minibossName[0];
|
|
}
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(file))))->std::string::assign(GHIDRA_CAST<byte *>(pppppbVar6),minibossNameSize);
|
|
}
|
|
}
|
|
local_8 = local_8 & 0xffffff00;
|
|
if (0xf < minibossNameCapacity) {
|
|
uVar3 = minibossNameCapacity + 1;
|
|
pppppbVar6 = minibossName[0];
|
|
if (0xfff < uVar3) {
|
|
pppppbVar6 = GHIDRA_CAST<byte *****>(minibossName[0][-1]);
|
|
uVar3 = minibossNameCapacity + 0x24;
|
|
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>((GHIDRA_INT(minibossName[0]) + (-4 - GHIDRA_INT(pppppbVar6))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pppppbVar6,uVar3);
|
|
}
|
|
}
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocatedBytes = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocatedBytes = GHIDRA_CAST<qword *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
if (text != GHIDRA_CAST<byte *>(0x0)) {
|
|
uVar3 = *GHIDRA_CAST<uint *>((text + -4));
|
|
qVar1 = *allocatedBytes;
|
|
*GHIDRA_CAST<uint *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar3;
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar1) < uVar3));
|
|
free(text + -4);
|
|
}
|
|
local_8 = 3;
|
|
(GHIDRA_CAST<xml_memory_pool *>((xmlMemoryPool)))->xml_memory_pool::clear();
|
|
bVar2 = 1;
|
|
}
|
|
ExceptionList = local_10;
|
|
return bVar2;
|
|
}
|
|
|
|
// 00834680
|
|
void Game::LoadBossRushXml(byte *param_1)
|
|
{
|
|
uint uVar1;
|
|
int *file;
|
|
int iVar2;
|
|
byte *pbVar3;
|
|
byte *pbVar4;
|
|
int *in_ECX;
|
|
char *pcVar5;
|
|
byte *pbVar6;
|
|
undefined8 *puVar7;
|
|
qword *allocatedBytes;
|
|
int iVar8;
|
|
undefined4 *attr;
|
|
void *ptr;
|
|
char *pcVar9;
|
|
bool isLess;
|
|
byte bVar10;
|
|
int enemyType;
|
|
int enemyVariant;
|
|
int enemyChunks;
|
|
byte *fileBuffer;
|
|
void *xmlNode;
|
|
void *waveSpawnsBegin;
|
|
undefined8 *waveSpawnsEnd;
|
|
undefined8 *waveSpawnsCapacity;
|
|
undefined4 *enemyNode;
|
|
int enemyCount;
|
|
undefined1 xmlDoc [48];
|
|
undefined1 xmlPool [65568];
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
qword oldAllocatedBytes;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b0225b;
|
|
local_10 = ExceptionList;
|
|
uVar1 = __security_cookie ^ GHIDRA_UINT((xmlPool + 0x1002c));
|
|
ExceptionList = &local_10;
|
|
file = (GHIDRA_CAST<FileSystem *>((&PTR_vftable_00c37a10)))->FileSystem::Open(param_1,GHIDRA_CAST<int *>(0x0));
|
|
if (file != GHIDRA_CAST<int *>(0x0)) {
|
|
iVar2 = (**(code **)(*file + 4))(uVar1);
|
|
fileBuffer = operator_new_tracked(iVar2 + 1);
|
|
(**(code **)(*file + 0x14))(fileBuffer,1,iVar2);
|
|
fileBuffer[iVar2] = 0;
|
|
(**(code **)*file)(1);
|
|
iVar2 = in_ECX[1];
|
|
iVar8 = *in_ECX;
|
|
if (iVar8 != iVar2) {
|
|
do {
|
|
std::vector<12byte>::_Tidy();
|
|
iVar8 = iVar8 + 0xc;
|
|
} while (iVar8 != iVar2);
|
|
iVar8 = *in_ECX;
|
|
}
|
|
in_ECX[1] = iVar8;
|
|
in_ECX[6] = 0;
|
|
in_ECX[7] = 0;
|
|
FUN_00413b90();
|
|
local_8 = 0;
|
|
iVar2 = 0x834759;
|
|
pbVar6 = fileBuffer;
|
|
(GHIDRA_CAST<rapidxml::xml_document *>((xmlDoc)))->rapidxml::xml_document::parse(fileBuffer);
|
|
xmlNode = (GHIDRA_CAST<xml_node *>((xmlDoc)))->xml_node::first_node(GHIDRA_CAST<byte *>("bossrush"),iVar2,(byte)pbVar6);
|
|
bVar10 = (byte)pbVar6;
|
|
attr = *GHIDRA_CAST<undefined4 **>((GHIDRA_CAST<char *>(xmlNode) + 0x20));
|
|
if (attr != GHIDRA_CAST<undefined4 *>(0x0)) {
|
|
do {
|
|
pbVar4 = GHIDRA_CAST<byte *>(*attr);
|
|
pcVar5 = "numWaves";
|
|
pbVar3 = &g_xmlNullStr;
|
|
if (pbVar4 != GHIDRA_CAST<byte *>(0x0)) {
|
|
pbVar3 = pbVar4;
|
|
}
|
|
do {
|
|
bVar10 = *pbVar3;
|
|
isLess = bVar10 < (byte)*pcVar5;
|
|
if (bVar10 != *pcVar5) {
|
|
LAB_008347b6:
|
|
uVar1 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_008347bb;
|
|
}
|
|
if (bVar10 == 0) break;
|
|
bVar10 = pbVar3[1];
|
|
isLess = bVar10 < (byte)pcVar5[1];
|
|
if (bVar10 != pcVar5[1]) goto LAB_008347b6;
|
|
pbVar3 = pbVar3 + 2;
|
|
pcVar5 = pcVar5 + 2;
|
|
} while (bVar10 != 0);
|
|
uVar1 = 0;
|
|
LAB_008347bb:
|
|
if (uVar1 == 0) {
|
|
pbVar6 = &g_xmlNullStr;
|
|
if (GHIDRA_CAST<byte *>(attr[1]) != GHIDRA_CAST<byte *>(0x0)) {
|
|
pbVar6 = GHIDRA_CAST<byte *>(attr[1]);
|
|
}
|
|
iVar2 = 0x8347d3;
|
|
iVar8 = atoi(GHIDRA_CAST<char *>(pbVar6));
|
|
in_ECX[6] = iVar8;
|
|
}
|
|
else {
|
|
pcVar5 = "spawnsPerWave";
|
|
pbVar3 = &g_xmlNullStr;
|
|
if (pbVar4 != GHIDRA_CAST<byte *>(0x0)) {
|
|
pbVar3 = pbVar4;
|
|
}
|
|
do {
|
|
bVar10 = *pbVar3;
|
|
isLess = bVar10 < (byte)*pcVar5;
|
|
if (bVar10 != *pcVar5) {
|
|
LAB_00834807:
|
|
uVar1 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_0083480c;
|
|
}
|
|
if (bVar10 == 0) break;
|
|
bVar10 = pbVar3[1];
|
|
isLess = bVar10 < (byte)pcVar5[1];
|
|
if (bVar10 != pcVar5[1]) goto LAB_00834807;
|
|
pbVar3 = pbVar3 + 2;
|
|
pcVar5 = pcVar5 + 2;
|
|
} while (bVar10 != 0);
|
|
uVar1 = 0;
|
|
LAB_0083480c:
|
|
if (uVar1 == 0) {
|
|
pbVar6 = &g_xmlNullStr;
|
|
if (GHIDRA_CAST<byte *>(attr[1]) != GHIDRA_CAST<byte *>(0x0)) {
|
|
pbVar6 = GHIDRA_CAST<byte *>(attr[1]);
|
|
}
|
|
iVar2 = 0x834824;
|
|
iVar8 = atoi(GHIDRA_CAST<char *>(pbVar6));
|
|
in_ECX[7] = iVar8;
|
|
}
|
|
}
|
|
bVar10 = (byte)pbVar6;
|
|
} while ((attr[4] != 0) && (attr = GHIDRA_CAST<undefined4 *>(attr[6]), attr != GHIDRA_CAST<undefined4 *>(0x0)));
|
|
}
|
|
xmlNode = (GHIDRA_CAST<xml_node *>((xmlNode)))->xml_node::first_node(GHIDRA_CAST<byte *>(&DAT_00b65804),iVar2,bVar10);
|
|
if (xmlNode != (void *)0x0) {
|
|
LAB_00834860:
|
|
waveSpawnsBegin = (void *)0x0;
|
|
waveSpawnsEnd = GHIDRA_CAST<undefined8 *>(0x0);
|
|
waveSpawnsCapacity = GHIDRA_CAST<undefined8 *>(0x0);
|
|
local_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),1);
|
|
pcVar5 = "enemy";
|
|
do {
|
|
pcVar9 = pcVar5;
|
|
pcVar5 = pcVar9 + 1;
|
|
} while (*pcVar5 != '\0');
|
|
enemyNode = *GHIDRA_CAST<undefined4 **>((GHIDRA_CAST<char *>(xmlNode) + 0x18));
|
|
if (enemyNode != GHIDRA_CAST<undefined4 *>(0x0)) {
|
|
do {
|
|
pbVar6 = GHIDRA_CAST<byte *>(*enemyNode);
|
|
if (pbVar6 == GHIDRA_CAST<byte *>(0x0)) {
|
|
pcVar5 = GHIDRA_CAST<char *>(0x0);
|
|
pbVar6 = &g_xmlNullStr;
|
|
}
|
|
else {
|
|
pcVar5 = GHIDRA_CAST<char *>(enemyNode[2]);
|
|
}
|
|
if (pcVar5 == pcVar9 + -0xb681ff) {
|
|
pbVar4 = pbVar6 + GHIDRA_INT(pcVar5);
|
|
if (pbVar4 <= pbVar6) goto LAB_008348e0;
|
|
iVar2 = GHIDRA_INT(&DAT_00b68200) - GHIDRA_INT(pbVar6);
|
|
while (*pbVar6 == pbVar6[iVar2]) {
|
|
pbVar6 = pbVar6 + 1;
|
|
if (pbVar4 <= pbVar6) goto LAB_008348e0;
|
|
}
|
|
}
|
|
enemyNode = GHIDRA_CAST<undefined4 *>(enemyNode[0xb]);
|
|
} while (enemyNode != GHIDRA_CAST<undefined4 *>(0x0));
|
|
enemyNode = GHIDRA_CAST<undefined4 *>(0x0);
|
|
}
|
|
goto LAB_00834b46;
|
|
}
|
|
LAB_00834bf5:
|
|
local_8 = 2;
|
|
(GHIDRA_CAST<xml_memory_pool *>((xmlPool)))->xml_memory_pool::clear();
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocatedBytes = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocatedBytes = GHIDRA_CAST<qword *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
if (fileBuffer != GHIDRA_CAST<byte *>(0x0)) {
|
|
uVar1 = *GHIDRA_CAST<uint *>((fileBuffer + -4));
|
|
oldAllocatedBytes = *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(oldAllocatedBytes) < uVar1));
|
|
free(fileBuffer + -4);
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
LAB_008348e0:
|
|
do {
|
|
attr = GHIDRA_CAST<undefined4 *>(enemyNode[8]);
|
|
enemyCount = 1;
|
|
enemyType = 0;
|
|
enemyVariant = 0;
|
|
enemyChunks = 1;
|
|
if (attr == GHIDRA_CAST<undefined4 *>(0x0)) {
|
|
LAB_008349b0:
|
|
iVar2 = enemyChunks;
|
|
puVar7 = waveSpawnsCapacity;
|
|
iVar8 = enemyCount;
|
|
do {
|
|
if (waveSpawnsEnd == puVar7) {
|
|
FUN_00834c60(waveSpawnsEnd,&enemyType);
|
|
iVar2 = enemyChunks;
|
|
puVar7 = waveSpawnsCapacity;
|
|
}
|
|
else {
|
|
*waveSpawnsEnd = CONCAT44(enemyVariant,enemyType);
|
|
*GHIDRA_CAST<int *>((waveSpawnsEnd + 1)) = iVar2;
|
|
waveSpawnsEnd = GHIDRA_CAST<undefined8 *>((GHIDRA_INT(waveSpawnsEnd) + 0xc));
|
|
}
|
|
iVar8 = iVar8 + -1;
|
|
} while (iVar8 != 0);
|
|
}
|
|
else {
|
|
do {
|
|
pbVar6 = GHIDRA_CAST<byte *>(*attr);
|
|
pbVar3 = &DAT_00b69a0c;
|
|
pbVar4 = &g_xmlNullStr;
|
|
if (pbVar6 != GHIDRA_CAST<byte *>(0x0)) {
|
|
pbVar4 = pbVar6;
|
|
}
|
|
do {
|
|
bVar10 = *pbVar4;
|
|
isLess = bVar10 < *pbVar3;
|
|
if (bVar10 != *pbVar3) {
|
|
LAB_0083495f:
|
|
uVar1 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_00834964;
|
|
}
|
|
if (bVar10 == 0) break;
|
|
bVar10 = pbVar4[1];
|
|
isLess = bVar10 < pbVar3[1];
|
|
if (bVar10 != pbVar3[1]) goto LAB_0083495f;
|
|
pbVar4 = pbVar4 + 2;
|
|
pbVar3 = pbVar3 + 2;
|
|
} while (bVar10 != 0);
|
|
uVar1 = 0;
|
|
LAB_00834964:
|
|
if (uVar1 == 0) {
|
|
pbVar6 = &g_xmlNullStr;
|
|
if (GHIDRA_CAST<byte *>(attr[1]) != GHIDRA_CAST<byte *>(0x0)) {
|
|
pbVar6 = GHIDRA_CAST<byte *>(attr[1]);
|
|
}
|
|
enemyType = atoi(GHIDRA_CAST<char *>(pbVar6));
|
|
}
|
|
else {
|
|
pcVar5 = "variant";
|
|
pbVar4 = &g_xmlNullStr;
|
|
if (pbVar6 != GHIDRA_CAST<byte *>(0x0)) {
|
|
pbVar4 = pbVar6;
|
|
}
|
|
do {
|
|
bVar10 = *pbVar4;
|
|
isLess = bVar10 < (byte)*pcVar5;
|
|
if (bVar10 != *pcVar5) {
|
|
LAB_00834a10:
|
|
uVar1 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_00834a15;
|
|
}
|
|
if (bVar10 == 0) break;
|
|
bVar10 = pbVar4[1];
|
|
isLess = bVar10 < (byte)pcVar5[1];
|
|
if (bVar10 != pcVar5[1]) goto LAB_00834a10;
|
|
pcVar5 = pcVar5 + 2;
|
|
pbVar4 = pbVar4 + 2;
|
|
} while (bVar10 != 0);
|
|
uVar1 = 0;
|
|
LAB_00834a15:
|
|
if (uVar1 == 0) {
|
|
pbVar6 = &g_xmlNullStr;
|
|
if (GHIDRA_CAST<byte *>(attr[1]) != GHIDRA_CAST<byte *>(0x0)) {
|
|
pbVar6 = GHIDRA_CAST<byte *>(attr[1]);
|
|
}
|
|
enemyVariant = atoi(GHIDRA_CAST<char *>(pbVar6));
|
|
}
|
|
else {
|
|
pcVar5 = "chunks";
|
|
pbVar4 = &g_xmlNullStr;
|
|
if (pbVar6 != GHIDRA_CAST<byte *>(0x0)) {
|
|
pbVar4 = pbVar6;
|
|
}
|
|
do {
|
|
bVar10 = *pbVar4;
|
|
isLess = bVar10 < (byte)*pcVar5;
|
|
if (bVar10 != *pcVar5) {
|
|
LAB_00834a70:
|
|
uVar1 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_00834a75;
|
|
}
|
|
if (bVar10 == 0) break;
|
|
bVar10 = pbVar4[1];
|
|
isLess = bVar10 < (byte)pcVar5[1];
|
|
if (bVar10 != pcVar5[1]) goto LAB_00834a70;
|
|
pcVar5 = pcVar5 + 2;
|
|
pbVar4 = pbVar4 + 2;
|
|
} while (bVar10 != 0);
|
|
uVar1 = 0;
|
|
LAB_00834a75:
|
|
if (uVar1 == 0) {
|
|
pbVar6 = &g_xmlNullStr;
|
|
if (GHIDRA_CAST<byte *>(attr[1]) != GHIDRA_CAST<byte *>(0x0)) {
|
|
pbVar6 = GHIDRA_CAST<byte *>(attr[1]);
|
|
}
|
|
enemyChunks = atoi(GHIDRA_CAST<char *>(pbVar6));
|
|
}
|
|
else {
|
|
pcVar5 = "count";
|
|
pbVar4 = &g_xmlNullStr;
|
|
if (pbVar6 != GHIDRA_CAST<byte *>(0x0)) {
|
|
pbVar4 = pbVar6;
|
|
}
|
|
do {
|
|
bVar10 = *pbVar4;
|
|
isLess = bVar10 < (byte)*pcVar5;
|
|
if (bVar10 != *pcVar5) {
|
|
LAB_00834ad0:
|
|
uVar1 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_00834ad5;
|
|
}
|
|
if (bVar10 == 0) break;
|
|
bVar10 = pbVar4[1];
|
|
isLess = bVar10 < (byte)pcVar5[1];
|
|
if (bVar10 != pcVar5[1]) goto LAB_00834ad0;
|
|
pcVar5 = pcVar5 + 2;
|
|
pbVar4 = pbVar4 + 2;
|
|
} while (bVar10 != 0);
|
|
uVar1 = 0;
|
|
LAB_00834ad5:
|
|
if (uVar1 == 0) {
|
|
pbVar6 = &g_xmlNullStr;
|
|
if (GHIDRA_CAST<byte *>(attr[1]) != GHIDRA_CAST<byte *>(0x0)) {
|
|
pbVar6 = GHIDRA_CAST<byte *>(attr[1]);
|
|
}
|
|
enemyCount = atoi(GHIDRA_CAST<char *>(pbVar6));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} while ((attr[4] != 0) && (attr = GHIDRA_CAST<undefined4 *>(attr[6]), attr != GHIDRA_CAST<undefined4 *>(0x0)));
|
|
if (0 < enemyCount) goto LAB_008349b0;
|
|
}
|
|
enemyNode = GHIDRA_CAST<undefined4 *>(enemyNode[0xb]);
|
|
} while (enemyNode != GHIDRA_CAST<undefined4 *>(0x0));
|
|
LAB_00834b46:
|
|
if (in_ECX[1] == in_ECX[2]) {
|
|
std::vector<12byte>::_Emplace_reallocate(in_ECX[1],&waveSpawnsBegin);
|
|
}
|
|
else {
|
|
FUN_008350d0(&waveSpawnsBegin);
|
|
in_ECX[1] = in_ECX[1] + 0xc;
|
|
}
|
|
local_8 = local_8 & 0xffffff00;
|
|
if (waveSpawnsBegin != (void *)0x0) {
|
|
uVar1 = ((GHIDRA_INT(waveSpawnsCapacity) - GHIDRA_INT(waveSpawnsBegin)) / 0xc) * 0xc;
|
|
ptr = waveSpawnsBegin;
|
|
if (0xfff < uVar1) {
|
|
ptr = *(void **)(GHIDRA_CAST<char *>(waveSpawnsBegin) + -4);
|
|
uVar1 = uVar1 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(waveSpawnsBegin) + (-4 - GHIDRA_INT(ptr))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(ptr,uVar1);
|
|
waveSpawnsBegin = (void *)0x0;
|
|
waveSpawnsEnd = GHIDRA_CAST<undefined8 *>(0x0);
|
|
waveSpawnsCapacity = GHIDRA_CAST<undefined8 *>(0x0);
|
|
}
|
|
xmlNode = *(void **)(GHIDRA_CAST<char *>(xmlNode) + 0x2c);
|
|
if (xmlNode == (void *)0x0) goto LAB_00834bf5;
|
|
goto LAB_00834860;
|
|
}
|
|
|
|
// 0085e370
|
|
int Game::GetNumEncounteredBosses()
|
|
{
|
|
return *GHIDRA_CAST<int *>((this->_encounteredBosses + 4)) - *GHIDRA_CAST<int *>(this->_encounteredBosses) >> 3;
|
|
}
|
|
|
|
// 0085e380
|
|
int * Game::GetScreenShakeCountdown()
|
|
{
|
|
return &this->_screenShakeTimer;
|
|
}
|
|
|
|
// 0085e390
|
|
void Game::UpdateStrangeAttractor(Vector *position, float force, float radius)
|
|
{
|
|
AttractEntities(this,position,(void *)0x0,(void *)0x0,force,radius);
|
|
return;
|
|
}
|
|
|
|
// 0085e3c0
|
|
void Game::AddStageWithoutHeartsPicked()
|
|
{
|
|
this->_stagesWithoutHeartsPicked = this->_stagesWithoutHeartsPicked + 1;
|
|
return;
|
|
}
|
|
|
|
// 0085e3d0
|
|
void Game::ClearStagesWithoutHeartsPicked()
|
|
{
|
|
this->_stagesWithoutHeartsPicked = 0;
|
|
return;
|
|
}
|
|
|
|
// 0085e3e0
|
|
int Game::GetStagesWithoutHeartsPicked()
|
|
{
|
|
return this->_stagesWithoutHeartsPicked;
|
|
}
|
|
|
|
// 0085e3f0
|
|
void Game::AddStageWithoutDamage()
|
|
{
|
|
this->_stagesWithoutDamage = this->_stagesWithoutDamage + 1;
|
|
return;
|
|
}
|
|
|
|
// 0085e400
|
|
void Game::ClearStagesWithoutDamage()
|
|
{
|
|
this->_stagesWithoutDamage = 0;
|
|
return;
|
|
}
|
|
|
|
// 008f74c0
|
|
void Game::render_mod_shaders()
|
|
{
|
|
int iVar1;
|
|
undefined4 *renderTargetEntry;
|
|
int iVar2;
|
|
undefined4 uVar3;
|
|
int *in_ECX;
|
|
void *pvVar4;
|
|
undefined4 ****ppppuVar5;
|
|
int *piVar6;
|
|
uint uVar7;
|
|
int iVar8;
|
|
float10 luaNumber;
|
|
undefined4 ****ppppuVar9;
|
|
undefined1 quad [112];
|
|
undefined4 quadUvs;
|
|
undefined4 local_cc;
|
|
undefined4 local_c8;
|
|
undefined4 local_c4;
|
|
undefined4 local_c0;
|
|
undefined4 local_bc;
|
|
undefined4 local_b8;
|
|
undefined4 local_b4;
|
|
undefined1 local_b0;
|
|
void *local_ac;
|
|
int local_a8;
|
|
undefined4 elementRef;
|
|
void *local_a0;
|
|
int local_9c;
|
|
undefined4 paramNameRef;
|
|
int vertexStrideBytes;
|
|
undefined8 local_90;
|
|
int modCursor;
|
|
int *modManager;
|
|
int vertexIndex;
|
|
int vertexData;
|
|
float *paramNameChars;
|
|
undefined4 ****local_70;
|
|
KColor KStack_6c;
|
|
float *vertexCursor;
|
|
int vertexOffset;
|
|
int *paramIter;
|
|
int paramOffset;
|
|
void *paramValueLuaState;
|
|
int paramValueRef;
|
|
int vertexStride;
|
|
undefined8 local_38;
|
|
int *shaderEntry;
|
|
void *luaState;
|
|
int paramsRef;
|
|
undefined1 *puStack_20;
|
|
void *local_1c;
|
|
undefined1 *puStack_18;
|
|
uint local_14;
|
|
char isNilNode;
|
|
int *nextNode;
|
|
float paramNameSize;
|
|
|
|
puStack_20 = GHIDRA_CAST<undefined1 *>((GHIDRA_INT(register0x00000010) + -4));
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00b079a5;
|
|
local_1c = ExceptionList;
|
|
ExceptionList = &local_1c;
|
|
modCursor = in_ECX[1];
|
|
if (modCursor != *in_ECX) {
|
|
modManager = in_ECX;
|
|
do {
|
|
iVar8 = modCursor;
|
|
if (*GHIDRA_CAST<char *>((*GHIDRA_CAST<int *>((modCursor + -4)) + 0xfd)) != '\0') {
|
|
piVar6 = *GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>((modCursor + -4)) + 0xe4));
|
|
if (piVar6 != GHIDRA_CAST<int *>(*piVar6)) {
|
|
do {
|
|
_glfw_context_reset(1);
|
|
if (g_renderTargetStackSize == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("PopRenderTarget: stack is empty!\n"));
|
|
}
|
|
renderTargetEntry = std::deque::back();
|
|
KAGE_Graphics::SetRenderTarget
|
|
(&DAT_00c798e0,(void *)*renderTargetEntry,*GHIDRA_CAST<byte *>((renderTargetEntry + 1)));
|
|
g_renderTargetStackSize = g_renderTargetStackSize - 1;
|
|
if (g_renderTargetStackSize == 0) {
|
|
DAT_00c7978c = 0;
|
|
}
|
|
(GHIDRA_CAST<RenderTarget *>((&DAT_00c798e0)))->RenderTarget::Clear();
|
|
g_graphicsManager_blendMode[0] = 0;
|
|
g_graphicsManager_blendMode[1] = 1;
|
|
g_graphicsManager_blendMode[2] = 0;
|
|
g_graphicsManager_blendMode[3] = 1;
|
|
KStack_6c._red = 1.0;
|
|
KStack_6c._green = 1.0;
|
|
KStack_6c._blue = 1.0;
|
|
KStack_6c._alpha = 1.0;
|
|
g_graphicsManager_blendMode[4] = 0;
|
|
local_c0 = 0;
|
|
quadUvs = 0;
|
|
local_c4 = 0;
|
|
local_cc = 0;
|
|
local_b8 = 0x3f800000;
|
|
local_c8 = 0x3f800000;
|
|
local_b4 = 0x3f800000;
|
|
local_bc = 0x3f800000;
|
|
local_b0 = 0;
|
|
KStack_6c._unk = 0;
|
|
render_quad_set_uniform_color(quad,0.0,0.0,g_screenWidth,g_screenHeight,&KStack_6c);
|
|
iVar2 = piVar6[1];
|
|
shaderEntry = piVar6 + 1;
|
|
pvVar4 = (void *)(*GHIDRA_CAST<int *>((iVar2 + 8)) + 0x18);
|
|
if ((pvVar4 != (void *)0x0) && ((*GHIDRA_CAST<byte *>((*GHIDRA_CAST<int *>((iVar2 + 8)) + 0x1c)) & 1) != 0)) {
|
|
iVar2 = *shaderEntry;
|
|
g_currentShader = pvVar4;
|
|
}
|
|
iVar2 = (**(code **)(**GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>((iVar2 + 8)) + 0x68)) + 0x14))
|
|
(&quadUvs,quad,g_drawRectUnset);
|
|
vertexData = iVar2;
|
|
if (iVar2 != 0) {
|
|
vertexStride = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*shaderEntry + 8)) + 0x78)) + 0xe;
|
|
lua_callback_run_get_shader_params(&luaState,*GHIDRA_CAST<int *>((*shaderEntry + 8)));
|
|
vertexCursor = GHIDRA_CAST<float *>((iVar2 + 0x28));
|
|
vertexStrideBytes = vertexStride << 2;
|
|
local_14 = 0;
|
|
vertexIndex = 0;
|
|
vertexOffset = 0;
|
|
piVar6 = shaderEntry;
|
|
iVar2 = vertexStride;
|
|
do {
|
|
pvVar4 = luaState;
|
|
paramOffset = 0xe;
|
|
iVar1 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*piVar6 + 8)) + 0x68)) + 0x10));
|
|
vertexCursor[-1] = (float)((double)iVar1 + __uint_to_double_fixup[-(iVar1 >> 0x1f)])
|
|
;
|
|
iVar1 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*piVar6 + 8)) + 0x68)) + 0x14));
|
|
*vertexCursor = (float)((double)iVar1 + __uint_to_double_fixup[-(iVar1 >> 0x1f)]);
|
|
iVar1 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*piVar6 + 8)) + 0x68)) + 0x18));
|
|
vertexCursor[1] = (float)((double)iVar1 + __uint_to_double_fixup[-(iVar1 >> 0x1f)]);
|
|
iVar1 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*piVar6 + 8)) + 0x68)) + 0x1c));
|
|
vertexCursor[2] = (float)((double)iVar1 + __uint_to_double_fixup[-(iVar1 >> 0x1f)]);
|
|
ppppuVar9 = GHIDRA_CAST<undefined4 ****>(g_screenPointScale);
|
|
vertexCursor[3] = g_screenPointScale;
|
|
if (paramsRef != -1) {
|
|
(GHIDRA_CAST<LuaRef *>((&luaState)))->LuaRef::push(luaState);
|
|
iVar2 = lua_type(pvVar4,0xffffffff);
|
|
lua_settop(luaState,0xfffffffe);
|
|
if ((iVar2 == 5) &&
|
|
(piVar6 = *GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>((*shaderEntry + 8)) + 0x70)),
|
|
paramIter = GHIDRA_CAST<int *>(*piVar6), paramIter != piVar6)) {
|
|
local_a0 = luaState;
|
|
local_9c = paramsRef;
|
|
do {
|
|
piVar6 = paramIter;
|
|
paramNameChars = GHIDRA_CAST<float *>((paramIter + 4));
|
|
paramNameSize = (float)paramIter[8];
|
|
local_70 = GHIDRA_CAST<undefined4 ****>(0x0);
|
|
KStack_6c._alpha = 0.0;
|
|
KStack_6c._unk = 0;
|
|
local_90 = (double)CONCAT44(paramNameSize,(undefined4)local_90);
|
|
if (0xf < GHIDRA_UINT(paramIter[9])) {
|
|
paramNameChars = GHIDRA_CAST<float *>(*paramNameChars);
|
|
}
|
|
if (GHIDRA_UINT(paramNameSize) < 0x10) {
|
|
ppppuVar9 = GHIDRA_CAST<undefined4 ****>(*paramNameChars);
|
|
KStack_6c._red = paramNameChars[1];
|
|
KStack_6c._green = paramNameChars[2];
|
|
KStack_6c._blue = paramNameChars[3];
|
|
KStack_6c._unk = 0xf;
|
|
KStack_6c._alpha = paramNameSize;
|
|
ppppuVar5 = &local_70;
|
|
local_70 = ppppuVar9;
|
|
}
|
|
else {
|
|
uVar7 = GHIDRA_UINT(paramNameSize) | 0xf;
|
|
if (0x7fffffff < uVar7) {
|
|
uVar7 = 0x7fffffff;
|
|
}
|
|
local_38 = (double)CONCAT44(uVar7,(undefined4)local_38);
|
|
local_70 = std::_Allocate(uVar7 + 1);
|
|
memcpy(local_70,paramNameChars,(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_INT(local_90))) + 0x4))) + 1);
|
|
KStack_6c._unk = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_INT(local_38))) + 0x4)));
|
|
KStack_6c._alpha = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_90)) + 0x4)));
|
|
ppppuVar5 = &local_70;
|
|
if (0xf < (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_38)) + 0x4)))) {
|
|
ppppuVar5 = local_70;
|
|
}
|
|
}
|
|
lua_pushlstring(luaState,ppppuVar5,KStack_6c._alpha);
|
|
paramNameRef = luaL_ref(luaState,0xfff0b9d8);
|
|
if (0xf < GHIDRA_UINT(KStack_6c._unk)) {
|
|
uVar7 = KStack_6c._unk + 1;
|
|
ppppuVar5 = local_70;
|
|
if (0xfff < uVar7) {
|
|
ppppuVar5 = GHIDRA_CAST<undefined4 ****>(local_70[-1]);
|
|
uVar7 = KStack_6c._unk + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(local_70) + (-4 - GHIDRA_INT(ppppuVar5))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(ppppuVar5,uVar7);
|
|
}
|
|
KStack_6c._alpha = 0.0;
|
|
KStack_6c._unk = 0xf;
|
|
local_70 = GHIDRA_CAST<undefined4 ****>((GHIDRA_UINT(local_70) & 0xffffff00));
|
|
paramValueLuaState = luaState;
|
|
FUN_0085c270(luaState);
|
|
paramValueRef = luaL_ref(luaState,0xfff0b9d8);
|
|
luaL_unref(luaState,0xfff0b9d8,paramNameRef);
|
|
if (piVar6[10] == 1) {
|
|
if (paramValueRef != -1) {
|
|
(GHIDRA_CAST<LuaRef *>((¶mValueLuaState)))->LuaRef::push(luaState);
|
|
uVar3 = lua_type(luaState,0xffffffff);
|
|
local_38 = (double)CONCAT44(uVar3,(undefined4)local_38);
|
|
lua_settop(luaState,0xfffffffe);
|
|
if ((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_38)) + 0x4))) != GHIDRA_CAST<undefined4 ****>(0x3)) goto LAB_008f79b0;
|
|
(GHIDRA_CAST<LuaRef *>((¶mValueLuaState)))->LuaRef::push(luaState);
|
|
uVar3 = lua_gettop(luaState);
|
|
luaNumber = (float10)luaL_checknumber(luaState,uVar3);
|
|
local_38 = (double)CONCAT44((float)luaNumber,(undefined4)local_38);
|
|
lua_settop(luaState,0xfffffffe);
|
|
*GHIDRA_CAST<undefined4 *****>((vertexData + (paramOffset + vertexOffset) * 4)) =
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_38)) + 0x4)));
|
|
ppppuVar9 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_38)) + 0x4)));
|
|
}
|
|
}
|
|
else {
|
|
LAB_008f79b0:
|
|
if (paramValueRef != -1) {
|
|
(GHIDRA_CAST<LuaRef *>((¶mValueLuaState)))->LuaRef::push(luaState);
|
|
uVar3 = lua_type(luaState,0xffffffff);
|
|
local_38 = (double)CONCAT44(uVar3,(undefined4)local_38);
|
|
lua_settop(luaState,0xfffffffe);
|
|
if ((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_38)) + 0x4))) == GHIDRA_CAST<undefined4 ****>(0x5)) {
|
|
(GHIDRA_CAST<LuaRef *>((¶mValueLuaState)))->LuaRef::push(luaState);
|
|
lua_len(luaState,0xffffffff);
|
|
luaNumber = (float10)luaL_checknumber(luaState,0xffffffff);
|
|
local_38 = (double)luaNumber;
|
|
lua_settop(luaState,0xfffffffe);
|
|
lua_settop(luaState,0xfffffffe);
|
|
if (GHIDRA_INT(local_38) == piVar6[10]) {
|
|
local_38 = (double)CONCAT44(1,(undefined4)local_38);
|
|
(GHIDRA_CAST<LuaRef *>((¶mValueLuaState)))->LuaRef::push(luaState);
|
|
lua_len(luaState,0xffffffff);
|
|
luaNumber = (float10)luaL_checknumber(luaState,0xffffffff);
|
|
local_90 = (double)luaNumber;
|
|
lua_settop(luaState,0xfffffffe);
|
|
lua_settop(luaState,0xfffffffe);
|
|
pvVar4 = luaState;
|
|
if (0 < GHIDRA_INT(local_90)) {
|
|
local_ac = luaState;
|
|
local_a8 = paramValueRef;
|
|
iVar8 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_INT(local_38))) + 0x4)));
|
|
do {
|
|
FUN_0085bfd0();
|
|
elementRef = luaL_ref(pvVar4,0xfff0b9d8);
|
|
FUN_008fc760();
|
|
*(undefined4 *****)
|
|
(vertexData + -4 + (vertexOffset + iVar8 + paramOffset) * 4) =
|
|
ppppuVar9;
|
|
luaL_unref(pvVar4,0xfff0b9d8,elementRef);
|
|
iVar8 = iVar8 + 1;
|
|
(GHIDRA_CAST<LuaRef *>((¶mValueLuaState)))->LuaRef::push(pvVar4);
|
|
lua_len(pvVar4,0xffffffff);
|
|
luaNumber = (float10)luaL_checknumber(pvVar4,0xffffffff);
|
|
local_38 = (double)luaNumber;
|
|
lua_settop(pvVar4,0xfffffffe);
|
|
lua_settop(pvVar4,0xfffffffe);
|
|
} while (iVar8 <= GHIDRA_INT(local_38));
|
|
piVar6 = paramIter;
|
|
iVar8 = modCursor;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
paramOffset = paramOffset + piVar6[10];
|
|
local_14 = local_14 & 0xffffff00;
|
|
luaL_unref(luaState,0xfff0b9d8,paramValueRef);
|
|
paramIter = GHIDRA_CAST<int *>(piVar6[2]);
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(paramIter) + 0xd)) == '\0') {
|
|
isNilNode = *GHIDRA_CAST<char *>((*paramIter + 0xd));
|
|
piVar6 = GHIDRA_CAST<int *>(*paramIter);
|
|
while (isNilNode == '\0') {
|
|
isNilNode = *GHIDRA_CAST<char *>((*piVar6 + 0xd));
|
|
paramIter = piVar6;
|
|
piVar6 = GHIDRA_CAST<int *>(*piVar6);
|
|
}
|
|
}
|
|
else {
|
|
isNilNode = *GHIDRA_CAST<char *>((piVar6[1] + 0xd));
|
|
nextNode = GHIDRA_CAST<int *>(piVar6[1]);
|
|
while ((paramIter = nextNode, isNilNode == '\0' &&
|
|
(piVar6 == GHIDRA_CAST<int *>(paramIter[2])))) {
|
|
isNilNode = *GHIDRA_CAST<char *>((paramIter[1] + 0xd));
|
|
nextNode = GHIDRA_CAST<int *>(paramIter[1]);
|
|
piVar6 = paramIter;
|
|
}
|
|
}
|
|
} while (paramIter != *GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>((*shaderEntry + 8)) + 0x70)));
|
|
}
|
|
piVar6 = shaderEntry;
|
|
iVar2 = vertexStride;
|
|
}
|
|
vertexCursor = GHIDRA_CAST<float *>((GHIDRA_INT(vertexCursor) + vertexStrideBytes));
|
|
vertexIndex = vertexIndex + 1;
|
|
vertexOffset = vertexOffset + iVar2;
|
|
} while (vertexIndex < 4);
|
|
local_14 = 0xffffffff;
|
|
luaL_unref(luaState,0xfff0b9d8,paramsRef);
|
|
}
|
|
piVar6 = GHIDRA_CAST<int *>(*shaderEntry);
|
|
} while (piVar6 != GHIDRA_CAST<int *>(**GHIDRA_CAST<undefined4 **>((*GHIDRA_CAST<int *>((iVar8 + -4)) + 0xe4))));
|
|
in_ECX = modManager;
|
|
}
|
|
}
|
|
modCursor = iVar8 + -4;
|
|
} while (modCursor != *in_ECX);
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 00959130
|
|
void Game::DeleteSaveState()
|
|
{
|
|
Manager *pMVar1;
|
|
|
|
pMVar1 = g_manager;
|
|
if (((g_game->_dailyChallenge)._id == 0) &&
|
|
(g_manager->_netplayManager == *GHIDRA_CAST<NetplayManager *>((g_manager + 1)))) {
|
|
(GHIDRA_CAST<GameState *>((&g_manager->_gamestate)))->GameState::Delete();
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((pMVar1->_persistentGameData))) + 0xf84)))) = 0;
|
|
*GHIDRA_CAST<undefined1 *>(&pMVar1->_persistentGameData) = 1;
|
|
pMVar1->_isSaveOnExit = 0;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 0095a4a0
|
|
void Game::end_save_progress()
|
|
{
|
|
NetplayManager *this;
|
|
uint uVar1;
|
|
Manager *pMVar2;
|
|
byte bVar3;
|
|
Entity_Player *player;
|
|
int unusedArg;
|
|
uint uVar4;
|
|
uint uVar5;
|
|
undefined8 uStack_c;
|
|
Game *game;
|
|
Manager *manager;
|
|
|
|
manager = g_manager;
|
|
this = &g_manager->_netplayManager;
|
|
if (g_manager->_netplayManager == *GHIDRA_CAST<NetplayManager *>((g_manager + 1))) goto LAB_0095a502;
|
|
if (g_game->_challenge == 0) {
|
|
uStack_c = CONCAT35((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(uStack_c)) + 0x5))),0x100000000);
|
|
if ((g_game->_dailyChallenge)._id != 0) goto LAB_0095a4db;
|
|
}
|
|
else {
|
|
LAB_0095a4db:
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(uStack_c)) + 0x4))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(uStack_c)) + 0x4))) & 0xffffff00;
|
|
}
|
|
FUN_0090cd10(1,(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(uStack_c)) + 0x4))));
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(manager[1]._gamestate)) + 0x918)))) = 0x25;
|
|
this->NetplayManager::update_lobby_stage_info();
|
|
LAB_0095a502:
|
|
pMVar2 = g_manager;
|
|
game = g_game;
|
|
if (((((g_game->_seedEffects)._isCustomRun == 0) &&
|
|
(bVar3 = (GHIDRA_CAST<Seeds *>((&g_game->_seedEffects)))->Seeds::AchievementUnlocksDisallowed(), bVar3 == 0)) &&
|
|
(bVar3 = Manager::IsGameplayInputActive(unusedArg), bVar3 == 0)) && (game->_isRerun == 0)) {
|
|
bVar3 = (pMVar2->_persistentGameData)._isReadOnly;
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("Setting PersistentGameData ReadOnly to %s\n"));
|
|
(pMVar2->_persistentGameData)._isReadOnly = 0;
|
|
if (*this == *GHIDRA_CAST<NetplayManager *>((manager + 1))) {
|
|
PersistentGameData::IncreaseEventCounter
|
|
(&g_manager->_persistentGameData,0x71,
|
|
-(g_manager->_persistentGameData)._eventCounters[0x71]);
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::IncreaseEventCounter(0x16,1);
|
|
uVar1 = (g_manager->_persistentGameData)._eventCounters[0x16];
|
|
uVar4 = (g_manager->_persistentGameData)._eventCounters[0x17];
|
|
if (uVar4 < uVar1) {
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::IncreaseEventCounter(0x17,uVar1 - uVar4)
|
|
;
|
|
}
|
|
}
|
|
manager = g_manager;
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("Setting PersistentGameData ReadOnly to %s\n"));
|
|
pMVar2 = g_manager;
|
|
(manager->_persistentGameData)._isReadOnly = bVar3;
|
|
if (2 < GHIDRA_UINT((pMVar2->_persistentGameData)._eventCounters[0x16])) {
|
|
(GHIDRA_CAST<PersistentGameData *>((&pMVar2->_persistentGameData)))->PersistentGameData::TryUnlock(0x142);
|
|
}
|
|
player = GetPlayer(g_game,0);
|
|
if (player->_playerType < 0x29) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(uStack_c)) + 0x4))) = (g_manager->_persistentGameData)._eventCounters[0x1f0];
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(uStack_c)) + 0x0))) = (g_manager->_persistentGameData)._eventCounters[0xbc];
|
|
player = GetPlayer(g_game,0);
|
|
uVar1 = player->_playerType;
|
|
uVar4 = 1 << (uVar1 & 0x1f);
|
|
uVar5 = 0;
|
|
if (0x1f < uVar1) {
|
|
uVar5 = uVar4;
|
|
}
|
|
uVar4 = uVar4 ^ uVar5;
|
|
if (0x3f < uVar1) {
|
|
uVar5 = uVar4;
|
|
}
|
|
if ((uVar4 & GHIDRA_UINT(uStack_c)) != 0 || (uVar5 & (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(uStack_c)) + 0x4)))) != 0) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(uStack_c)) + 0x4))) = 0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(uStack_c)) + 0x0))) = 0;
|
|
}
|
|
PersistentGameData::set_run_mask
|
|
(&g_manager->_persistentGameData,uVar4 | GHIDRA_UINT(uStack_c),uVar5 | (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(uStack_c)) + 0x4))));
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 009807a0
|
|
void Game::ShowFortuneText(RNG *rng, byte *category)
|
|
{
|
|
uint uVar1;
|
|
undefined4 *puVar2;
|
|
undefined4 *puVar3;
|
|
byte *pbVar4;
|
|
uint uVar5;
|
|
undefined4 *newNode;
|
|
undefined4 ****ppppuVar6;
|
|
uint uVar7;
|
|
undefined4 ***stringCount;
|
|
undefined4 ****ppppuVar8;
|
|
uint uVar9;
|
|
byte *local_4c;
|
|
undefined4 ****local_48;
|
|
RNG *local_44;
|
|
byte *local_40;
|
|
undefined4 *lines;
|
|
int lineCount;
|
|
byte ch;
|
|
undefined4 ****curLine [4];
|
|
uint curLineSize;
|
|
uint curLineCapacity;
|
|
uint local_18;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 ***local_8;
|
|
Manager *manager;
|
|
|
|
manager = g_manager;
|
|
local_8 = GHIDRA_CAST<undefined4 ***>(0xffffffff);
|
|
puStack_c = &LAB_00b0ccc5;
|
|
local_10 = ExceptionList;
|
|
local_18 = __security_cookie ^ GHIDRA_UINT((curLine + 0xb));
|
|
ExceptionList = &local_10;
|
|
local_40 = category;
|
|
local_44 = rng;
|
|
pbVar4 = GHIDRA_CAST<byte *>(FUN_00a62e10(local_18));
|
|
local_4c = pbVar4;
|
|
std::map<const_char_ptr_4byte>::find(&local_48,&local_4c);
|
|
stringCount = GHIDRA_CAST<undefined4 ***>(0x0);
|
|
if (local_48 != (manager->_stringTable)._categories._head) {
|
|
stringCount = local_48[6];
|
|
}
|
|
if (pbVar4 != GHIDRA_CAST<byte *>(0x0)) {
|
|
local_8 = GHIDRA_CAST<undefined4 ***>(0x0);
|
|
tracked_alloc(1,pbVar4,0);
|
|
local_8 = GHIDRA_CAST<undefined4 ***>(0xffffffff);
|
|
}
|
|
uVar5 = (GHIDRA_CAST<RNG *>((local_44)))->RNG::RandomInt(GHIDRA_UINT(stringCount));
|
|
pbVar4 = StringTable::get_string_by_index
|
|
(&g_manager->_stringTable,local_40,*GHIDRA_CAST<int *>(&g_manager->_stringTable),uVar5);
|
|
lines = GHIDRA_CAST<undefined4 *>(0x0);
|
|
lineCount = 0;
|
|
local_4c = pbVar4;
|
|
lines = operator_new(0x20);
|
|
*lines = lines;
|
|
lines[1] = lines;
|
|
curLineSize = 0;
|
|
curLineCapacity = 0xf;
|
|
curLine[0] = GHIDRA_CAST<undefined4 ****>(0x0);
|
|
local_8 = GHIDRA_CAST<undefined4 ***>(0x2);
|
|
ch = *pbVar4;
|
|
uVar5 = 0xf;
|
|
uVar9 = 0xf;
|
|
if (ch != 0) {
|
|
while( true ) {
|
|
uVar7 = curLineSize;
|
|
ppppuVar6 = curLine[0];
|
|
puVar3 = lines;
|
|
if (ch == 0x7c) {
|
|
if (lineCount == 0x7ffffff) goto LAB_00980a4b;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 3;
|
|
newNode = operator_new(0x20);
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>((newNode + 2)))))->std::string::string(curLine);
|
|
local_8 = GHIDRA_CAST<undefined4 ***>(CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),2));
|
|
lineCount = lineCount + 1;
|
|
puVar2 = GHIDRA_CAST<undefined4 *>(puVar3[1]);
|
|
*newNode = puVar3;
|
|
newNode[1] = puVar2;
|
|
puVar3[1] = newNode;
|
|
*puVar2 = newNode;
|
|
ppppuVar6 = curLine;
|
|
if (0xf < curLineCapacity) {
|
|
ppppuVar6 = curLine[0];
|
|
}
|
|
curLineSize = 0;
|
|
*GHIDRA_CAST<undefined1 *>(ppppuVar6) = 0;
|
|
uVar5 = curLineCapacity;
|
|
}
|
|
else if (curLineSize < uVar9) {
|
|
ppppuVar6 = curLine;
|
|
if (0xf < uVar9) {
|
|
ppppuVar6 = curLine[0];
|
|
}
|
|
pbVar4 = GHIDRA_CAST<byte *>((GHIDRA_INT(ppppuVar6) + curLineSize));
|
|
curLineSize = curLineSize + 1;
|
|
*pbVar4 = ch;
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(ppppuVar6) + uVar7 + 1)) = 0;
|
|
uVar5 = curLineCapacity;
|
|
}
|
|
else {
|
|
if (curLineSize == 0x7fffffff) {
|
|
/* WARNING: Subroutine does not return */
|
|
std::string::_Xlen();
|
|
}
|
|
uVar5 = curLineSize + 1 | 0xf;
|
|
if (uVar5 < 0x80000000) {
|
|
if (0x7fffffff - (uVar9 >> 1) < uVar9) {
|
|
uVar5 = 0x7fffffff;
|
|
}
|
|
else {
|
|
uVar1 = uVar9 + (uVar9 >> 1);
|
|
if (uVar5 < uVar1) {
|
|
uVar5 = uVar1;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
uVar5 = 0x7fffffff;
|
|
}
|
|
local_48 = std::_Allocate(uVar5 + 1);
|
|
curLineSize = uVar7 + 1;
|
|
local_40 = GHIDRA_CAST<byte *>((GHIDRA_INT(local_48) + uVar7));
|
|
local_44 = GHIDRA_CAST<RNG *>((uVar7 + 1 + GHIDRA_INT(local_48)));
|
|
curLineCapacity = uVar5;
|
|
if (uVar9 < 0x10) {
|
|
memcpy(local_48,curLine,uVar7);
|
|
*local_40 = ch;
|
|
*GHIDRA_CAST<undefined1 *>(&local_44->_seed) = 0;
|
|
}
|
|
else {
|
|
memcpy(local_48,ppppuVar6,uVar7);
|
|
*local_40 = ch;
|
|
uVar7 = uVar9 + 1;
|
|
*GHIDRA_CAST<undefined1 *>(&local_44->_seed) = 0;
|
|
ppppuVar8 = ppppuVar6;
|
|
if (0xfff < uVar7) {
|
|
ppppuVar8 = GHIDRA_CAST<undefined4 ****>(ppppuVar6[-1]);
|
|
uVar7 = uVar9 + 0x24;
|
|
if (GHIDRA_CAST<undefined1 *>(0x1f) < GHIDRA_CAST<undefined1 *>((GHIDRA_INT(ppppuVar6) + (-4 - GHIDRA_INT(ppppuVar8)))))
|
|
goto LAB_00980ad1;
|
|
}
|
|
operator_delete(ppppuVar8,uVar7);
|
|
}
|
|
curLine[0] = local_48;
|
|
}
|
|
puVar3 = lines;
|
|
local_4c = local_4c + 1;
|
|
ch = *local_4c;
|
|
if (ch == 0) break;
|
|
uVar9 = uVar5;
|
|
}
|
|
if (curLineSize != 0) {
|
|
if (lineCount == 0x7ffffff) {
|
|
LAB_00980a4b:
|
|
/* WARNING: Subroutine does not return */
|
|
std::_Xlength_error("list too long");
|
|
}
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 4;
|
|
newNode = operator_new(0x20);
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>((newNode + 2)))))->std::string::string(curLine);
|
|
local_8 = GHIDRA_CAST<undefined4 ***>(CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),2));
|
|
lineCount = lineCount + 1;
|
|
puVar2 = GHIDRA_CAST<undefined4 *>(puVar3[1]);
|
|
*newNode = puVar3;
|
|
newNode[1] = puVar2;
|
|
puVar3[1] = newNode;
|
|
*puVar2 = newNode;
|
|
uVar5 = curLineCapacity;
|
|
}
|
|
}
|
|
ppppuVar6 = curLine[0];
|
|
(GHIDRA_CAST<HUD *>((&g_game->_hud)))->HUD::render_fortune_text(&lines);
|
|
if (0xf < uVar5) {
|
|
uVar9 = uVar5 + 1;
|
|
ppppuVar8 = ppppuVar6;
|
|
if (0xfff < uVar9) {
|
|
ppppuVar8 = GHIDRA_CAST<undefined4 ****>(ppppuVar6[-1]);
|
|
uVar9 = uVar5 + 0x24;
|
|
if (GHIDRA_CAST<undefined1 *>(0x1f) < GHIDRA_CAST<undefined1 *>((GHIDRA_INT(ppppuVar6) + (-4 - GHIDRA_INT(ppppuVar8))))) {
|
|
LAB_00980ad1:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(ppppuVar8,uVar9);
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>(lines[1]) = 0;
|
|
puVar3 = GHIDRA_CAST<undefined4 *>(*lines);
|
|
while (puVar3 != GHIDRA_CAST<undefined4 *>(0x0)) {
|
|
puVar2 = GHIDRA_CAST<undefined4 *>(*puVar3);
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>((puVar3 + 2)))))->std::string::_Tidy_deallocate();
|
|
operator_delete(puVar3,0x20);
|
|
puVar3 = puVar2;
|
|
}
|
|
operator_delete(lines,0x20);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00983970
|
|
byte Game::IsGreedBoss()
|
|
{
|
|
int difficulty;
|
|
|
|
difficulty = g_game->_difficulty;
|
|
if ((g_game->_greedModeWave + 1U < (difficulty == 3) + 9) ||
|
|
((difficulty != 2 && (difficulty != 3)))) {
|
|
return 0;
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 009839b0
|
|
byte Game::IsGreedFinalBoss()
|
|
{
|
|
int difficulty;
|
|
|
|
difficulty = g_game->_difficulty;
|
|
if ((g_game->_greedModeWave + 1U < (difficulty == 3) + 0xb) ||
|
|
((difficulty != 2 && (difficulty != 3)))) {
|
|
return 0;
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 0098dba0
|
|
void Game::update_map_input()
|
|
{
|
|
byte bVar1;
|
|
char cVar2;
|
|
uint uVar3;
|
|
uint peerIndex;
|
|
int iVar4;
|
|
int *in_ECX;
|
|
void *playersEnd;
|
|
NetplayManager peer;
|
|
NetplayManager extraout_ECX;
|
|
NetplayManager *extraout_ECX_00;
|
|
NetplayManager *netplay;
|
|
int *playerSlot;
|
|
uint peerCount;
|
|
PlayerManager *playerManager;
|
|
Entity *pEVar5;
|
|
int *piVar6;
|
|
float fVar7;
|
|
int device;
|
|
int *deviceRefCount;
|
|
int *local_20;
|
|
float local_1c;
|
|
float local_18;
|
|
Entity *local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
Game *game;
|
|
bool isMapHeld;
|
|
float targetOpacity;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b0d4ad;
|
|
local_10 = ExceptionList;
|
|
uVar3 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
ExceptionList = &local_10;
|
|
local_20 = in_ECX;
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
}
|
|
isMapHeld = false;
|
|
playerManager = &g_game->_playerManager;
|
|
local_18 = 0.0;
|
|
piVar6 = in_ECX;
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) - GHIDRA_INT((playerManager->_playerList)._begin) >> 2
|
|
!= 0) {
|
|
do {
|
|
playersEnd = (playerManager->_playerList)._end;
|
|
playerSlot = (playerManager->_playerList)._begin;
|
|
if (GHIDRA_INT(playersEnd) - GHIDRA_INT(playerSlot) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
playersEnd = (playerManager->_playerList)._end;
|
|
playerSlot = (playerManager->_playerList)._begin;
|
|
}
|
|
if (GHIDRA_UINT(local_18) < GHIDRA_UINT((GHIDRA_INT(playersEnd) - GHIDRA_INT(playerSlot) >> 2))) {
|
|
playerSlot = playerSlot + GHIDRA_INT(local_18);
|
|
}
|
|
pEVar5 = GHIDRA_CAST<Entity *>(*playerSlot);
|
|
local_14 = pEVar5;
|
|
if (isMapHeld) {
|
|
LAB_0098dcbe:
|
|
isMapHeld = true;
|
|
}
|
|
else {
|
|
peer = g_manager->_netplayManager;
|
|
if (peer != *GHIDRA_CAST<NetplayManager *>((g_manager + 1))) {
|
|
peerCount = GHIDRA_INT(*GHIDRA_CAST<NetplayManager *>((g_manager + 1))) - GHIDRA_INT(peer) >> 2;
|
|
peerIndex = 0;
|
|
if (peerCount != 0) {
|
|
do {
|
|
if (*GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>(peer) + 0xc)) == pEVar5[5]._color._colorize[0]) {
|
|
cVar2 = (**(code **)(*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(peer) + 0x370)) + 0x14))(uVar3);
|
|
peer = extraout_ECX;
|
|
if (cVar2 == '\0') {
|
|
pEVar5 = local_14;
|
|
goto LAB_0098dd0a;
|
|
}
|
|
break;
|
|
}
|
|
peerIndex = peerIndex + 1;
|
|
peer = (NetplayManager)(GHIDRA_INT(peer) + 4);
|
|
} while (peerIndex < peerCount);
|
|
}
|
|
}
|
|
pEVar5 = local_14;
|
|
bVar1 = input_is_action_pressed(0xd,GHIDRA_INT(local_14[5]._color._colorize[0]),local_14,GHIDRA_INT(peer))
|
|
;
|
|
if (bVar1 != 0) goto LAB_0098dcbe;
|
|
LAB_0098dd0a:
|
|
isMapHeld = false;
|
|
}
|
|
in_ECX = local_20;
|
|
peer = g_manager->_netplayManager;
|
|
if (peer != *GHIDRA_CAST<NetplayManager *>((g_manager + 1))) {
|
|
local_1c = pEVar5[5]._color._colorize[0];
|
|
peerIndex = 0;
|
|
peerCount = GHIDRA_INT(*GHIDRA_CAST<NetplayManager *>((g_manager + 1))) - GHIDRA_INT(peer) >> 2;
|
|
if (peerCount != 0) {
|
|
do {
|
|
piVar6 = in_ECX;
|
|
if (*GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>(peer) + 0xc)) == local_1c) {
|
|
cVar2 = (**(code **)(*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(peer) + 0x370)) + 0x14))();
|
|
if (cVar2 == '\0') goto LAB_0098de0e;
|
|
break;
|
|
}
|
|
peerIndex = peerIndex + 1;
|
|
peer = (NetplayManager)(GHIDRA_INT(peer) + 4);
|
|
} while (peerIndex < peerCount);
|
|
}
|
|
}
|
|
pEVar5 = local_14;
|
|
in_ECX = piVar6;
|
|
if (g_manager->_netplayManager != *GHIDRA_CAST<NetplayManager *>((g_manager + 1))) {
|
|
(GHIDRA_CAST<InputManager *>((&PTR_vftable_00c57b18)))->InputManager::get_device(&device,GHIDRA_INT(local_14[5]._color._colorize[0]))
|
|
;
|
|
local_8 = 0;
|
|
if (((device != 0) &&
|
|
(local_1c = (float)__RTDynamicCast(device,0,&KAGE::Input::InputDeviceBase::
|
|
RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::NetInputDevice::
|
|
RTTI_Type_Descriptor,0), local_1c != 0.0)) &&
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_1c) + 0x378)) != 0)) {
|
|
if (isMapHeld) {
|
|
LAB_0098ddda:
|
|
isMapHeld = true;
|
|
}
|
|
else {
|
|
netplay = &g_manager->_netplayManager;
|
|
if (*netplay == *GHIDRA_CAST<NetplayManager *>((g_manager + 1))) {
|
|
LAB_0098ddb1:
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_1c) + 0x378)) == 0) {
|
|
iVar4 = -0x21524111;
|
|
}
|
|
else {
|
|
iVar4 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_1c) + 0x378)) + 0xc));
|
|
}
|
|
bVar1 = input_is_action_pressed(0xd,iVar4,pEVar5,GHIDRA_INT(netplay));
|
|
if (bVar1 != 0) goto LAB_0098ddda;
|
|
}
|
|
else {
|
|
bVar1 = (GHIDRA_CAST<NetplayManager *>((netplay)))->NetplayManager::IsIdxLocalPlayer(GHIDRA_UINT(pEVar5[5]._color._colorize[0]));
|
|
netplay = extraout_ECX_00;
|
|
if (bVar1 != 0) goto LAB_0098ddb1;
|
|
}
|
|
isMapHeld = false;
|
|
}
|
|
}
|
|
local_8 = 1;
|
|
if (((deviceRefCount != GHIDRA_CAST<int *>(0x0)) &&
|
|
(cVar2 = (**(code **)(*deviceRefCount + 0xc))(), cVar2 != '\0')) &&
|
|
(g_inputDeviceRelease != (void *)0x0)) {
|
|
(*g_inputDeviceRelease)(&device);
|
|
}
|
|
local_8 = 0xffffffff;
|
|
}
|
|
LAB_0098de0e:
|
|
game = g_game;
|
|
playerManager = &g_game->_playerManager;
|
|
local_18 = (float)(GHIDRA_INT(local_18) + 1);
|
|
piVar6 = in_ECX;
|
|
} while (GHIDRA_UINT(local_18) <
|
|
GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((playerManager->_playerList)._begin) >> 2)));
|
|
if ((isMapHeld) && (in_ECX[2] = in_ECX[2] + 1, in_ECX[2] == 10)) {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(game))))->Level::ShowName(1);
|
|
}
|
|
}
|
|
if (0 < in_ECX[0x187]) {
|
|
in_ECX[0x187] = in_ECX[0x187] + -1;
|
|
local_20 = GHIDRA_CAST<int *>(in_ECX[0x188]);
|
|
local_14 = GHIDRA_CAST<Entity *>(in_ECX[0x189]);
|
|
uVar3 = Random();
|
|
local_1c = (float)((double)GHIDRA_INT(uVar3) + __uint_to_double_fixup[-(GHIDRA_INT(uVar3) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
local_18 = (float)in_ECX[0x187] / 10.0;
|
|
local_1c = local_1c + local_1c;
|
|
fVar7 = cos(local_1c);
|
|
local_20 = GHIDRA_CAST<int *>((fVar7 * local_18 + (float)local_20 * 0.5));
|
|
fVar7 = sin(local_1c);
|
|
in_ECX[0x188] = GHIDRA_INT(local_20);
|
|
in_ECX[0x189] = GHIDRA_INT((fVar7 * local_18 + (float)local_14 * 0.5));
|
|
}
|
|
iVar4 = *in_ECX;
|
|
if (iVar4 == 0) {
|
|
if (0.9 <= (float)in_ECX[0x5c]) {
|
|
fVar7 = 1.0;
|
|
}
|
|
else {
|
|
fVar7 = (float)in_ECX[0x5c] + 0.1;
|
|
}
|
|
in_ECX[0x5c] = GHIDRA_INT(fVar7);
|
|
if ((float)in_ECX[0xb4] <= 0.2) {
|
|
fVar7 = 0.0;
|
|
}
|
|
else {
|
|
fVar7 = (float)in_ECX[0xb4] - 0.2;
|
|
}
|
|
in_ECX[0xb4] = GHIDRA_INT(fVar7);
|
|
LAB_0098e157:
|
|
if (isMapHeld) {
|
|
*in_ECX = 1;
|
|
goto LAB_0098df73;
|
|
}
|
|
}
|
|
else if (iVar4 == 1) {
|
|
if ((char)in_ECX[1] == '\0') {
|
|
if ((float)in_ECX[0x5c] <= 0.2) {
|
|
fVar7 = 0.0;
|
|
}
|
|
else {
|
|
fVar7 = (float)in_ECX[0x5c] - 0.2;
|
|
}
|
|
in_ECX[0x5c] = GHIDRA_INT(fVar7);
|
|
if (GHIDRA_UINT(in_ECX[2]) < 9) {
|
|
if (isMapHeld) goto LAB_0098e0cd;
|
|
*in_ECX = 2;
|
|
*GHIDRA_CAST<undefined1 *>((in_ECX + 1)) = 1;
|
|
}
|
|
else {
|
|
in_ECX[0xb4] = 0x3f800000;
|
|
if (isMapHeld) goto LAB_0098df73;
|
|
*in_ECX = 0;
|
|
}
|
|
}
|
|
else {
|
|
in_ECX[0x5c] = 0;
|
|
if (GHIDRA_UINT(in_ECX[2]) < 9) {
|
|
if (isMapHeld) {
|
|
LAB_0098e0cd:
|
|
in_ECX[0xb4] = GHIDRA_INT(((float)in_ECX[0xb4] + 0.1));
|
|
goto LAB_0098df73;
|
|
}
|
|
*in_ECX = 0;
|
|
*GHIDRA_CAST<undefined1 *>((in_ECX + 1)) = 0;
|
|
}
|
|
else {
|
|
in_ECX[0xb4] = 0x3f800000;
|
|
if (isMapHeld) goto LAB_0098df73;
|
|
*in_ECX = 2;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
if (iVar4 == 2) {
|
|
in_ECX[2] = 0;
|
|
if ((float)in_ECX[0x5c] <= 0.2) {
|
|
fVar7 = 0.0;
|
|
}
|
|
else {
|
|
fVar7 = (float)in_ECX[0x5c] - 0.2;
|
|
}
|
|
in_ECX[0x5c] = GHIDRA_INT(fVar7);
|
|
fVar7 = (float)in_ECX[0xb4];
|
|
targetOpacity = (g_manager->_optionsConfig)._mapOpacity;
|
|
if (fVar7 <= targetOpacity + 0.1) {
|
|
if (targetOpacity - 0.1 <= fVar7) {
|
|
in_ECX[0xb4] = GHIDRA_INT(targetOpacity);
|
|
}
|
|
else {
|
|
in_ECX[0xb4] = GHIDRA_INT((fVar7 + 0.1));
|
|
}
|
|
}
|
|
else {
|
|
in_ECX[0xb4] = GHIDRA_INT((fVar7 - 0.1));
|
|
}
|
|
goto LAB_0098e157;
|
|
}
|
|
if (isMapHeld) goto LAB_0098df73;
|
|
}
|
|
game = g_game;
|
|
in_ECX[2] = 0;
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&((game->_hud))) + 0x3ce5))) == '\0') {
|
|
(GHIDRA_CAST<HUD_Message *>((&(game->_hud)._messageMain)))->HUD_Message::text_out();
|
|
}
|
|
LAB_0098df73:
|
|
fVar7 = (float)in_ECX[0x5c];
|
|
if (fVar7 <= 0.0) {
|
|
fVar7 = 0.0;
|
|
}
|
|
if (1.0 <= fVar7) {
|
|
fVar7 = 1.0;
|
|
}
|
|
in_ECX[0x5c] = GHIDRA_INT(fVar7);
|
|
fVar7 = (float)in_ECX[0xb4];
|
|
if (fVar7 <= 0.0) {
|
|
fVar7 = 0.0;
|
|
}
|
|
if (1.0 <= fVar7) {
|
|
fVar7 = 1.0;
|
|
}
|
|
in_ECX[0xb4] = GHIDRA_INT(fVar7);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 009960b0
|
|
void Game::start_poop_cloud_screen_effect(ColorMod *color)
|
|
{
|
|
int iVar1;
|
|
code *pcVar2;
|
|
void *pvVar3;
|
|
void *pvVar4;
|
|
float fVar5;
|
|
undefined1 *puVar6;
|
|
char isLastRef;
|
|
void *pvVar7;
|
|
uint seed;
|
|
byte bVar8;
|
|
undefined1 loadedImage [4];
|
|
int *loadedImageRef;
|
|
int *local_30;
|
|
uint local_2c;
|
|
int cloudOffset;
|
|
undefined4 rngShift3;
|
|
undefined1 *puStack_20;
|
|
void *local_1c;
|
|
undefined1 *puStack_18;
|
|
undefined4 local_14;
|
|
void **colorField;
|
|
Game *game;
|
|
|
|
puStack_20 = loadedImage + 0x34;
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00b0d62d;
|
|
local_1c = ExceptionList;
|
|
ExceptionList = &local_1c;
|
|
colorField = &this->_roomList[0].SavedGridEntities._capacity;
|
|
if (GHIDRA_CAST<ColorMod *>(colorField) != color) {
|
|
pvVar7 = (void *)color->_tint[1];
|
|
pvVar3 = (void *)color->_tint[2];
|
|
pvVar4 = (void *)color->_tint[3];
|
|
*colorField = (void *)color->_tint[0];
|
|
this->_roomList[0].SavedEntities._begin = pvVar7;
|
|
this->_roomList[0].SavedEntities._end = pvVar3;
|
|
this->_roomList[0].SavedEntities._capacity = pvVar4;
|
|
fVar5 = color->_colorize[1];
|
|
pvVar7 = (void *)color->_colorize[2];
|
|
pvVar3 = (void *)color->_colorize[3];
|
|
this->_roomList[0].RestrictedGridIndexes._head = (void *)color->_colorize[0];
|
|
this->_roomList[0].RestrictedGridIndexes._size = GHIDRA_UINT(fVar5);
|
|
this->_roomList[0].SavedEffects._begin = pvVar7;
|
|
this->_roomList[0].SavedEffects._end = pvVar3;
|
|
*GHIDRA_CAST<undefined8 *>(&this->_roomList[0].SavedEffects._capacity) = *GHIDRA_CAST<undefined8 *>(color->_offset);
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this->_roomList[0])) + 0x98)))) = color->_offset[2];
|
|
}
|
|
game = g_game;
|
|
iVar1 = this->_roomList[0]._doors[1];
|
|
if (iVar1 < 1) {
|
|
this->_roomList[0]._doors[1] = 0xb4;
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_INT(&this->_roomList[0].SpawnSeed) + 1)) = 0;
|
|
this->_roomList[0].DisplayFlags = 3;
|
|
this->_roomList[0].VisitedCount = 0x3dcccccd;
|
|
this->_roomList[0].Flags = 0x3f800000;
|
|
this->_roomList[0].TotalMoneySpent = 0;
|
|
this->_roomList[0].ClearCount = -0x4100;
|
|
this->_roomList[0].GreedSubType = 0x3f000000;
|
|
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 4));
|
|
seed = 0;
|
|
if (iVar1 != 0) {
|
|
seed = *GHIDRA_CAST<uint *>((iVar1 + 0x58));
|
|
}
|
|
rngShift3 = 7;
|
|
puVar6 = loadedImage + 0x34;
|
|
if (this->_roomList[0]._doors[3] == 0) {
|
|
pvVar7 = Manager::LoadImage(loadedImage,GHIDRA_CAST<byte *>("gfx/backdrop/pooclouds.png"));
|
|
local_14 = 0;
|
|
(GHIDRA_CAST<KAGE::SmartPointer *>((this->_roomList[0]._doors + 3)))->KAGE::SmartPointer::operator_assign(pvVar7);
|
|
local_14 = 1;
|
|
if (loadedImageRef != GHIDRA_CAST<int *>(0x0)) {
|
|
isLastRef = (**(code **)(*loadedImageRef + 0xc))();
|
|
if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) {
|
|
(*g_imageReleaseFn)(loadedImage);
|
|
}
|
|
}
|
|
local_14 = 0xffffffff;
|
|
local_30 = GHIDRA_CAST<int *>(this->_roomList[0]._doors[3]);
|
|
if (local_30 == GHIDRA_CAST<int *>(0x0)) {
|
|
this->_roomList[0]._doors[1] = 0;
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("[warn] failed to load pooclouds.png\n"));
|
|
puVar6 = puStack_20;
|
|
}
|
|
else if ((local_30[0xe] != 0) || (puVar6 = puStack_20, local_30[0xf] != 0)) {
|
|
(**(code **)(*local_30 + 0x48))(0,0);
|
|
local_30[0xe] = 0;
|
|
local_30[0xf] = 0;
|
|
puVar6 = puStack_20;
|
|
}
|
|
}
|
|
puStack_20 = puVar6;
|
|
std::vector<20byte>::resize(this->_roomList[0].DisplayFlags);
|
|
local_30 = GHIDRA_CAST<int *>(0x0);
|
|
if (0 < this->_roomList[0].DisplayFlags) {
|
|
cloudOffset = 0;
|
|
do {
|
|
if (seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
seed = seed >> 5 ^ seed;
|
|
seed = seed << 9 ^ seed;
|
|
bVar8 = (byte)rngShift3;
|
|
seed = seed >> (bVar8 & 0x1f) ^ seed;
|
|
*GHIDRA_CAST<float *>((this->_roomList[0]._doors[5] + 8 + cloudOffset)) =
|
|
(float)((double)GHIDRA_INT(seed) + __uint_to_double_fixup[-(GHIDRA_INT(seed) >> 0x1f)]) *
|
|
2.3283062e-10 *
|
|
((float)this->_roomList[0].Flags - (float)this->_roomList[0].VisitedCount) +
|
|
(float)this->_roomList[0].VisitedCount;
|
|
if (seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
seed = seed >> 5 ^ seed;
|
|
seed = seed << 9 ^ seed;
|
|
seed = seed >> (bVar8 & 0x1f) ^ seed;
|
|
*GHIDRA_CAST<float *>((this->_roomList[0]._doors[5] + 0xc + cloudOffset)) =
|
|
((float)this->_roomList[0].GreedSubType - *GHIDRA_CAST<float *>(&this->_roomList[0].TotalMoneySpent)
|
|
) * (float)((double)GHIDRA_INT(seed) + __uint_to_double_fixup[-(GHIDRA_INT(seed) >> 0x1f)]) *
|
|
2.3283062e-10 + *GHIDRA_CAST<float *>(&this->_roomList[0].TotalMoneySpent);
|
|
if (seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
seed = seed >> 5 ^ seed;
|
|
seed = seed << 9 ^ seed;
|
|
local_2c = seed >> (bVar8 & 0x1f) ^ seed;
|
|
iVar1 = *GHIDRA_CAST<int *>((this->_roomList[0]._doors[3] + 0x10));
|
|
*GHIDRA_CAST<float *>((cloudOffset + this->_roomList[0]._doors[5])) =
|
|
(float)((double)iVar1 + __uint_to_double_fixup[-(iVar1 >> 0x1f)]) *
|
|
(float)((double)GHIDRA_INT(local_2c) + __uint_to_double_fixup[-(GHIDRA_INT(local_2c) >> 0x1f)]) *
|
|
2.3283062e-10;
|
|
if (local_2c == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
local_2c = local_2c >> 5 ^ local_2c;
|
|
local_2c = local_2c << 9 ^ local_2c;
|
|
local_2c = local_2c >> (bVar8 & 0x1f) ^ local_2c;
|
|
iVar1 = *GHIDRA_CAST<int *>((this->_roomList[0]._doors[3] + 0x14));
|
|
*GHIDRA_CAST<float *>((this->_roomList[0]._doors[5] + 4 + cloudOffset)) =
|
|
(float)((double)iVar1 + __uint_to_double_fixup[-(iVar1 >> 0x1f)]) *
|
|
(float)((double)GHIDRA_INT(local_2c) + __uint_to_double_fixup[-(GHIDRA_INT(local_2c) >> 0x1f)]) *
|
|
2.3283062e-10;
|
|
if (local_2c == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
seed = local_2c >> 5 ^ local_2c;
|
|
seed = seed << 9 ^ seed;
|
|
seed = seed >> (bVar8 & 0x1f) ^ seed;
|
|
*GHIDRA_CAST<bool *>((this->_roomList[0]._doors[5] + 0x10 + cloudOffset)) =
|
|
(float)((double)GHIDRA_INT(seed) + __uint_to_double_fixup[-(GHIDRA_INT(seed) >> 0x1f)]) *
|
|
2.3283062e-10 < 0.5;
|
|
if (seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
seed = seed >> 5 ^ seed;
|
|
seed = seed << 9 ^ seed;
|
|
seed = seed >> (bVar8 & 0x1f) ^ seed;
|
|
*GHIDRA_CAST<bool *>((this->_roomList[0]._doors[5] + 0x11 + cloudOffset)) =
|
|
(float)((double)GHIDRA_INT(seed) + __uint_to_double_fixup[-(GHIDRA_INT(seed) >> 0x1f)]) *
|
|
2.3283062e-10 < 0.5;
|
|
cloudOffset = cloudOffset + 0x14;
|
|
local_30 = GHIDRA_CAST<int *>((GHIDRA_INT(local_30) + 1));
|
|
} while (GHIDRA_INT(local_30) < this->_roomList[0].DisplayFlags);
|
|
}
|
|
}
|
|
else if (iVar1 < 0x96) {
|
|
this->_roomList[0]._doors[1] = GHIDRA_INT((180.0 - (((float)iVar1 - 0.0) / 150.0) * 30.0));
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|