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>
57 lines
1.9 KiB
C++
57 lines
1.9 KiB
C++
#include "classes.h"
|
|
|
|
// 005b1530
|
|
byte Card::IsCard()
|
|
{
|
|
int temp_5f0a49bdf4;
|
|
|
|
temp_5f0a49bdf4 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x58));
|
|
if ((((temp_5f0a49bdf4 == 0) || (temp_5f0a49bdf4 == 1)) || (temp_5f0a49bdf4 == 3)) ||
|
|
(temp_5f0a49bdf4 == 5)) {
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 005b1550
|
|
byte Card::IsRune()
|
|
{
|
|
return *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x58)) == 2;
|
|
}
|
|
|
|
// 00730aa0
|
|
uint Card::IsAvailable()
|
|
{
|
|
Entity_Player *achievementID;
|
|
undefined3 extraout_var;
|
|
int *in_ECX;
|
|
Game *game;
|
|
byte isUnlocked;
|
|
|
|
game = g_game;
|
|
if (g_game != GHIDRA_CAST<Game *>(0x0)) {
|
|
if (((char)in_ECX[0x14] == '\0') &&
|
|
((achievementID = GHIDRA_CAST<Entity_Player *>(g_game->_difficulty), achievementID == GHIDRA_CAST<Entity_Player *>(0x2)
|
|
|| (achievementID == GHIDRA_CAST<Entity_Player *>(0x3))))) goto LAB_00730af6;
|
|
if (*in_ECX == 0x2e) {
|
|
achievementID = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::FirstPlayerByType(0x13);
|
|
if (achievementID != GHIDRA_CAST<Entity_Player *>(0x0)) goto LAB_00730af6;
|
|
}
|
|
if (1 < *GHIDRA_CAST<int *>(&game->_deathmatchManager)) {
|
|
achievementID =
|
|
GHIDRA_CAST<Entity_Player *>((**(code **)(*GHIDRA_CAST<int *>((game->_deathmatchManager)._type) + 0x24))(*in_ECX));
|
|
if ((char)achievementID != '\0') goto LAB_00730af6;
|
|
}
|
|
}
|
|
achievementID = GHIDRA_CAST<Entity_Player *>(in_ECX[1]);
|
|
if (-1 < GHIDRA_INT(achievementID)) {
|
|
isUnlocked = (GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::Unlocked(GHIDRA_INT(achievementID));
|
|
achievementID = GHIDRA_CAST<Entity_Player *>(CONCAT31(extraout_var,isUnlocked));
|
|
if (isUnlocked == 0) {
|
|
LAB_00730af6:
|
|
return GHIDRA_UINT(achievementID) & 0xffffff00;
|
|
}
|
|
}
|
|
return CONCAT31((int3)(GHIDRA_UINT(achievementID) >> 8),1);
|
|
}
|