Reconstruction layout: generated-src/ (generated) and src/ (curated), CMake, the first takeover: RNG
The decompiled C++ tree moves to generated-src/ (classes.h, C++20); src/ is for code written by hand. A curated function defines the generated declaration and starts its comment with its address, and source_tree.py stops emitting that body. src/rng.cpp takes over RNG (SetSeed, the constructor, Next, RandomInt, RandomFloat, Shuffle) with the shift table read from the exe as a constexpr array; src/log.h names KAGE_LogMessage's levels (1 INFO, 2 NET, 4 WARN, 8 ERROR, 16 ASSERT, from its prefix jump table). CMakeLists.txt builds src/*.cpp against generated-src/classes.h (clean with -Wall -Wextra). structs.hpp and headers.py are retired: scripts/merge_fields.py writes the merged field list, classes.h checks the layout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2ff2d5d87f
commit
3ce74c6e2d
331 files changed
+485
-7835
No files matched your search
@@ -0,0 +1,57 @@
|
||||
#include "classes.h"
|
||||
|
||||
// 00a0d850
|
||||
void Weapon_Tears::Reset()
|
||||
{
|
||||
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x44)) = 0;
|
||||
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x48)) = 0;
|
||||
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x4c)) = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
// 00a0d8e0
|
||||
float10 Weapon_Tears::GetMaxCharge()
|
||||
{
|
||||
float chargeMultiplier;
|
||||
uint weaponFlags;
|
||||
|
||||
weaponFlags = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x34));
|
||||
chargeMultiplier = 1.0;
|
||||
if ((weaponFlags >> 8 & 1) == 0) {
|
||||
if ((weaponFlags & 1) != 0) {
|
||||
chargeMultiplier = 2.5;
|
||||
}
|
||||
if ((weaponFlags >> 1 & 1) != 0) {
|
||||
chargeMultiplier = chargeMultiplier + chargeMultiplier;
|
||||
}
|
||||
if (chargeMultiplier <= 1.0) {
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
chargeMultiplier = 12.0;
|
||||
}
|
||||
return (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x10)) + 1.0) * chargeMultiplier - 1.0;
|
||||
}
|
||||
|
||||
// 00a0d950
|
||||
undefined1 Weapon_Tears::CanTriggerCursedEyeTeleport()
|
||||
{
|
||||
int iVar1;
|
||||
float10 fVar2;
|
||||
|
||||
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 4));
|
||||
if ((iVar1 != 0) && (*GHIDRA_CAST<int *>((iVar1 + 0x28)) == 1)) {
|
||||
if ((*GHIDRA_CAST<int *>((iVar1 + 0x140c)) != 0) &&
|
||||
(iVar1 = this->GetMarkedTargetVariant(), iVar1 != 0)) {
|
||||
return 0;
|
||||
}
|
||||
if ((((*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x34)) >> 8 & 1) == 0) && (0.0 < *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x14)))) &&
|
||||
(fVar2 = (float10)this->GetMaxCharge(),
|
||||
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x14)) <= (float)fVar2 && (float)fVar2 != *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x14)))
|
||||
) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user