Test round 1 fixes (headless harness, about 8M frames, 731 items, 41 characters, every floor and menu, entity sweeps and 1,100 fuzz runs): EntityList's destructor frees the room's entities on restart (00417e50, a pool leak that crashed long sweeps), the Online Awards stats page (Menu_OnlineAwards, 008e6a80), Mr. Me's wisp errand across rooms, the boss warning count, tooth, coin and stone tear sprite scale, NPC status first-match order, an effect's idle animation range

This commit is contained in:
shweet committed 2026-11-23 20:19:41 -05:00
1 parent ff2c61a63a
commit aefd3e2098
24 files changed
+231 -345

No files matched your search

+1 -1
View File
@@ -886,7 +886,7 @@
008e4b10 Menu_Online::Update MenuManager::Update case 0x13: Cursor, "Daily Run"/"Friend Match"/"Options" entries; render 008e4e30 (#Online/ONLINE_DAILY_DESCRIPTOR ...) 008e4b10 Menu_Online::Update MenuManager::Update case 0x13: Cursor, "Daily Run"/"Friend Match"/"Options" entries; render 008e4e30 (#Online/ONLINE_DAILY_DESCRIPTOR ...)
008e3830 Menu_Mods::Update MenuManager::Update case 0x10 (MainMenuType MODS): WidgetTab, "/disable.it" 008e3830 Menu_Mods::Update MenuManager::Update case 0x10 (MainMenuType MODS): WidgetTab, "/disable.it"
008d6b30 Menu_Collection::render_item_pool_icons ? once from the collection detail renderer 008d5440 (CollectibleTitle/CollectibleDesc/CollectibleItemPools): ItemPool::GetItemPoolsForCollectible then IconShop/IconTreasureRoom/IconBoss/IconDevilRoom/IconAngelRoom/IconPlanetarium... ItemPoolChests anims 008d6b30 Menu_Collection::render_item_pool_icons ? once from the collection detail renderer 008d5440 (CollectibleTitle/CollectibleDesc/CollectibleItemPools): ItemPool::GetItemPoolsForCollectible then IconShop/IconTreasureRoom/IconBoss/IconDevilRoom/IconAngelRoom/IconPlanetarium... ItemPoolChests anims
008e6a80 Menu_Online::render_descriptions ? in the menu render sequence between the online menus; string_table_translate(manager+0x4a920, key+"_DESC"), "??????" placeholder, DescriptionPos/TextStartPos null frames, Font::DrawStringScaled; this+0x109/+0x70 flags 008e6a80 Menu_OnlineAwards::Render ECX=MenuManager+0xf5cc, the online awards page: string_table_translate(manager+0x4a920, key+"_DESC"), "??????" placeholder, DescriptionPos/TextStartPos null frames, Font::DrawStringScaled; this+0x109/+0x70 flags
0091d2b0 OnlineChat::render ? sprintf "%s:" name prefix lines, KAGE_ColorShader via FUN_00a140c0, Entity_Familiar::GetPlayerSlot for colors; caller 0091e650 used by the lobby render 008e8af0 and HUD 0090b900 0091d2b0 OnlineChat::render ? sprintf "%s:" name prefix lines, KAGE_ColorShader via FUN_00a140c0, Entity_Familiar::GetPlayerSlot for colors; caller 0091e650 used by the lobby render 008e8af0 and HUD 0090b900
00906260 SaveSlotManager::constructor ? constructs a ~0x1c90-byte object: PersistentGameData at +0x5c, ANM2s at +0x10b4/+0x18e4/+0x1a18, KColor; called once from the manager constructor 00950610 (writes manager+0x4b3bc..) 00906260 SaveSlotManager::constructor ? constructs a ~0x1c90-byte object: PersistentGameData at +0x5c, ANM2s at +0x10b4/+0x18e4/+0x1a18, KColor; called once from the manager constructor 00950610 (writes manager+0x4b3bc..)
0091a450 load_persistent_game_data_buffer ? (buffer): temp PersistentGameData::constructor then parses the save buffer with FUN_0091b0f0/FUN_0091b960, "Attempting to retrieve read-only buffer in a writable mode", set<int> lookups; from 0090c560 0091a450 load_persistent_game_data_buffer ? (buffer): temp PersistentGameData::constructor then parses the save buffer with FUN_0091b0f0/FUN_0091b960, "Attempting to retrieve read-only buffer in a writable mode", set<int> lookups; from 0090c560
Can't render this file because it is too large.
+3 -3
View File
@@ -779262,14 +779262,14 @@ LAB_008e6a5a:
} }
//@@ 008e6a80 Menu_Online::render_descriptions //@@ 008e6a80 Menu_OnlineAwards::Render
/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */ /* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */
/* DB: ? in the menu render sequence between the online menus; /* DB: ? in the menu render sequence between the online menus;
string_table_translate(manager+0x4a920, key+"_DESC"), "??????" placeholder, string_table_translate(manager+0x4a920, key+"_DESC"), "??????" placeholder,
DescriptionPos/TextStartPos null frames, Font::DrawStringScaled; this+0x109/+0x70 flags */ DescriptionPos/TextStartPos null frames, Font::DrawStringScaled; this+0x109/+0x70 flags */
void Menu_Online::render_descriptions(void) void Menu_OnlineAwards::Render(void)
{ {
std_string *keySize; std_string *keySize;
@@ -894975,7 +894975,7 @@ void __thiscall MenuManager::Render(MenuManager *this)
Menu_Online::Render(&menuManager->_menuOnline); Menu_Online::Render(&menuManager->_menuOnline);
Menu_Options::Render((Menu_Options *)&menuManager->field_0xeb50); Menu_Options::Render((Menu_Options *)&menuManager->field_0xeb50);
Menu_Online::render_mode_select(); Menu_Online::render_mode_select();
Menu_Online::render_descriptions(); Menu_OnlineAwards::Render();
Menu_Save::Render((Menu_Save *)&menuManager->_menuSave); Menu_Save::Render((Menu_Save *)&menuManager->_menuSave);
imageRefCount = (Vector *)0x98a2c5; imageRefCount = (Vector *)0x98a2c5;
Leaderboard::Render((Leaderboard *)&menuManager->field_0x1178); Leaderboard::Render((Leaderboard *)&menuManager->field_0x1178);
+1 -1
View File
@@ -7235,7 +7235,7 @@
008e68a0 FUN_008e68a0 53 008e68a0 FUN_008e68a0 53
008e68e0 FUN_008e68e0 173 008e68e0 FUN_008e68e0 173
008e69a0 FUN_008e69a0 216 008e69a0 FUN_008e69a0 216
008e6a80 Menu_Online::render_descriptions 1845 008e6a80 Menu_OnlineAwards::Render 1845
008e71c0 FUN_008e71c0 137 008e71c0 FUN_008e71c0 137
008e7250 Menu_OnlineAwards::Update 586 008e7250 Menu_OnlineAwards::Update 586
008e74d0 FUN_008e74d0 130 008e74d0 FUN_008e74d0 130
Can't render this file because it is too large.
+4 -4
View File
@@ -301,7 +301,7 @@
00b1c518 #Online/COOP_AWARD_LUSTFUL 00425b70:init_coop_awards 00b1c518 #Online/COOP_AWARD_LUSTFUL 00425b70:init_coop_awards
00b1c534 #Online/COOP_AWARD_SLOTHFUL 00425b70:init_coop_awards 00b1c534 #Online/COOP_AWARD_SLOTHFUL 00425b70:init_coop_awards
00b1c550 CoopStats::get_player_info() did not have data for user %llu \n 00426560:FUN_00426560 00917fd0:FUN_00917fd0 00b1c550 CoopStats::get_player_info() did not have data for user %llu \n 00426560:FUN_00426560 00917fd0:FUN_00917fd0
00b1c590 _DESC 008e6a80:Menu_Online::render_descriptions 00b1c590 _DESC 008e6a80:Menu_OnlineAwards::Render
00b1c5a4 No deathmatch room for current level\n 00b1c5a4 No deathmatch room for current level\n
00b1c5cc #Online/DEATHMATCH_WINNER 004299ba 00b1c5cc #Online/DEATHMATCH_WINNER 004299ba
00b1c5e8 #Online/DEATHMATCH_DRAW 00429b04 00b1c5e8 #Online/DEATHMATCH_DRAW 00429b04
@@ -8337,10 +8337,10 @@ z
00b76168 ##GAME###Online/ONLY_FOUND_JOIN_IN_PROGRESS 008e64f0:online_quick_match_popup_callback 00b76168 ##GAME###Online/ONLY_FOUND_JOIN_IN_PROGRESS 008e64f0:online_quick_match_popup_callback
00b76194 Doodle Position 008e4e30:Menu_Online::Render 00b76194 Doodle Position 008e4e30:Menu_Online::Render
00b761a4 ##GAME###Online/SEARCHING_FOR_LOBBIES 008e5420:Menu_Online::start_quick_match 00b761a4 ##GAME###Online/SEARCHING_FOR_LOBBIES 008e5420:Menu_Online::start_quick_match
00b761cc ?????? 008e6a80:Menu_Online::render_descriptions 008e6a80:Menu_Online::render_descriptions 00b761cc ?????? 008e6a80:Menu_OnlineAwards::Render 008e6a80:Menu_OnlineAwards::Render
00b761d4 DescriptionPos 008e6a80:Menu_Online::render_descriptions 00b761d4 DescriptionPos 008e6a80:Menu_OnlineAwards::Render
00b761e4 gfx/ui/main menu/OnlineStatsMenu.anm2 00988d80:MenuManager::LoadGraphics 00b761e4 gfx/ui/main menu/OnlineStatsMenu.anm2 00988d80:MenuManager::LoadGraphics
00b7620c TextStartPos 008e6a80:Menu_Online::render_descriptions 00b7620c TextStartPos 008e6a80:Menu_OnlineAwards::Render
00b7621c ##GAME###Online/NO_CONNECTION_TO_HOST 008e8240:Menu_OnlineLobby::Update 00b7621c ##GAME###Online/NO_CONNECTION_TO_HOST 008e8240:Menu_OnlineLobby::Update
00b76244 gfx/ui/stage/eden_b_head.anm2 008e7b24 00b76244 gfx/ui/stage/eden_b_head.anm2 008e7b24
00b76264 PlayerInfo 008e9ac0:Menu_OnlineLobby::init_lobby_view 008e9ac0:Menu_OnlineLobby::init_lobby_view 008e7f60:Menu_OnlineLobby::load_graphics 008e7f60:Menu_OnlineLobby::load_graphics 008e7f60:Menu_OnlineLobby::load_graphics 008e9ac0:Menu_OnlineLobby::init_lobby_view 00b76264 PlayerInfo 008e9ac0:Menu_OnlineLobby::init_lobby_view 008e9ac0:Menu_OnlineLobby::init_lobby_view 008e7f60:Menu_OnlineLobby::load_graphics 008e7f60:Menu_OnlineLobby::load_graphics 008e7f60:Menu_OnlineLobby::load_graphics 008e9ac0:Menu_OnlineLobby::init_lobby_view
Can't render this file because it is too large.
+2 -6
View File
@@ -349,6 +349,7 @@ struct HUD;
struct HUD_Message; struct HUD_Message;
struct HWND__; struct HWND__;
struct HallucinationOverlay; struct HallucinationOverlay;
struct Harness;
struct HeartGain; struct HeartGain;
struct History; struct History;
struct HistoryHUD; struct HistoryHUD;
@@ -366,6 +367,7 @@ struct InfoDisplayItem;
struct InfoDisplayText; struct InfoDisplayText;
struct InputBindings; struct InputBindings;
struct InputConfig; struct InputConfig;
struct InputDelta;
struct InputDeviceBase; struct InputDeviceBase;
struct InputManager; struct InputManager;
struct InviteFriendsMenu; struct InviteFriendsMenu;
@@ -3123,7 +3125,6 @@ struct Menu_Online {
static void start_quick_match(); // 008e5420 static void start_quick_match(); // 008e5420
void render_descriptor(std_string *text); // 008e5790 void render_descriptor(std_string *text); // 008e5790
static void on_quick_match_search_result(int *param_1, int param_2); // 008e5f40 static void on_quick_match_search_result(int *param_1, int param_2); // 008e5f40
static void render_descriptions(); // 008e6a80
uint8_t _pad_0x0[0x4]; uint8_t _pad_0x0[0x4];
uint8_t _anm2[0x228]; // ANM2 uint8_t _anm2[0x228]; // ANM2
@@ -5331,7 +5332,6 @@ EntityConfig * FUN_00417910(); // 00417910
int FUN_00417920(); // 00417920 int FUN_00417920(); // 00417920
void FUN_00417dd0(); // 00417dd0 void FUN_00417dd0(); // 00417dd0
void FUN_00417df0(); // 00417df0 void FUN_00417df0(); // 00417df0
void FUN_00417e50(); // 00417e50
int FUN_0041b770(int param_1); // 0041b770 int FUN_0041b770(int param_1); // 0041b770
void FUN_0041c670(); // 0041c670 void FUN_0041c670(); // 0041c670
int FUN_0041c6f0(uint32_t param_1); // 0041c6f0 int FUN_0041c6f0(uint32_t param_1); // 0041c6f0
@@ -8104,7 +8104,6 @@ void FUN_008e6880(int *param_1); // 008e6880
void FUN_008e68a0(char param_1, int param_2); // 008e68a0 void FUN_008e68a0(char param_1, int param_2); // 008e68a0
void FUN_008e68e0(); // 008e68e0 void FUN_008e68e0(); // 008e68e0
int * FUN_008e69a0(uint32_t param_1); // 008e69a0 int * FUN_008e69a0(uint32_t param_1); // 008e69a0
void FUN_008e71c0(); // 008e71c0
void FUN_008e74d0(uint8_t param_1); // 008e74d0 void FUN_008e74d0(uint8_t param_1); // 008e74d0
int online_lobby_find_member_index(void *user); // 008e7560 int online_lobby_find_member_index(void *user); // 008e7560
void FUN_008e7610(); // 008e7610 void FUN_008e7610(); // 008e7610
@@ -20240,9 +20239,6 @@ float clamp(float min, float max, float value); // 0042f2a0
float timescale_factor(float acceleration, float timeScale); // 00684cb0 float timescale_factor(float acceleration, float timeScale); // 00684cb0
float lerp(float a, float b, float t, uint8_t isClamped); // 00a155c0 float lerp(float a, float b, float t, uint8_t isClamped); // 00a155c0
} }
namespace Menu_OnlineAwards {
void Update(); // 008e7250
}
namespace NetLogging { namespace NetLogging {
void format_callstack(uint32_t param_1, uint32_t param_2); // 00904a60 void format_callstack(uint32_t param_1, uint32_t param_2); // 00904a60
} }
-288
View File
@@ -1389,291 +1389,3 @@ LAB_008e6318:
*listHead = GHIDRA_INT(local_84); *listHead = GHIDRA_INT(local_84);
goto LAB_008e6323; goto LAB_008e6323;
} }
// 008e6a80
void Menu_Online::render_descriptions()
{
std_string *keySize;
float fVar1;
float fVar2;
float *nullFrame;
uint8_t *translatedText;
Vector *pos;
Font *pFVar3;
uint8_t *****pppppbVar4;
int in_ECX;
uint8_t *strCursor;
uint32_t uVar5;
uint8_t *statKey;
int statIndex;
Vector hiddenValuePos;
Vector valuePos;
Vector descriptionPos;
int statOffset;
KColor textColor;
Vector labelPos;
float columnX;
float rowY;
Vector local_88;
uint32_t fontSettings;
uint32_t local_7c;
uint32_t local_78;
uint32_t local_74;
uint32_t local_70;
uint32_t local_6c;
uint32_t local_68;
uint8_t *****descriptionText [4];
uint32_t descriptionTextSize;
uint32_t descriptionTextCapacity;
uint8_t *****tmpString [4];
uint32_t tmpStringSize;
uint32_t tmpStringCapacity;
uint8_t countText [32];
uint32_t stackCookie;
void *local_10;
uint8_t *puStack_c;
uint32_t local_8;
int statCount;
uint8_t strChar;
local_8 = 0xffffffff;
puStack_c = &LAB_00b06c45;
local_10 = ExceptionList;
stackCookie = __security_cookie ^ GHIDRA_UINT((countText + 0x30));
ExceptionList = &local_10;
local_88.x = (g_menuManager->_ViewPosition).x + *GHIDRA_CAST<float *>((in_ECX + 0x128));
local_88.y = (g_menuManager->_ViewPosition).y + *GHIDRA_CAST<float *>((in_ECX + 300));
if (*GHIDRA_CAST<char *>((in_ECX + 0x109)) != '\0') {
if (*GHIDRA_CAST<char *>((in_ECX + 0x70)) == '\0') {
AnimationState::Render
(GHIDRA_CAST<AnimationState *>((in_ECX + 0x30)),&local_88,&g_vectorZero,&g_vectorZero);
AnimationState::Render
(GHIDRA_CAST<AnimationState *>((in_ECX + 0x50)),&local_88,&g_vectorZero,&g_vectorZero);
}
else {
AnimationState::Render
(GHIDRA_CAST<AnimationState *>((in_ECX + 0x50)),&local_88,&g_vectorZero,&g_vectorZero);
AnimationState::Render
(GHIDRA_CAST<AnimationState *>((in_ECX + 0x30)),&local_88,&g_vectorZero,&g_vectorZero);
}
}
fVar2 = local_88.y;
fVar1 = local_88.x;
if (*GHIDRA_CAST<int *>((in_ECX + 0x34)) == 0) {
nullFrame = GHIDRA_CAST<float *>(0x0);
}
else {
nullFrame = AnimationState::GetNullFrame
(GHIDRA_CAST<AnimationState *>((in_ECX + 0x30)),GHIDRA_CAST<uint8_t *>("TextStartPos"));
}
labelPos.y = fVar2 + nullFrame[1];
statIndex = 0;
labelPos.x = fVar1 + *nullFrame;
statKey = GHIDRA_CAST<uint8_t *>(&DAT_00c78f08);
statOffset = 0xa8c;
columnX = labelPos.x;
rowY = labelPos.y;
local_88.y = labelPos.y;
do {
statCount = *GHIDRA_CAST<int *>(((g_manager->_persistentGameData)._achievements + statOffset + -0x38));
if ((0 < statIndex) && (statIndex == (statIndex / 7) * 7)) {
labelPos.x = columnX + 126.0;
labelPos.y = local_88.y;
columnX = labelPos.x;
rowY = local_88.y;
}
sprintf_s(countText,0x20,s__d);
fontSettings = 0;
local_7c = 0xffff;
local_78 = 0;
local_74 = 0x3f800000;
local_70 = 0xffffffff;
local_6c = 0;
local_68 = 0;
if (statCount < 1) {
textColor._unk = 0;
textColor._red = 0.21176471;
textColor._green = 0.18431373;
textColor._blue = 0.1764706;
textColor._alpha = 0.8;
local_8 = 3;
Font::DrawStringScaled
(&g_manager->_font1_TeamMeatEx10,GHIDRA_CAST<uint8_t *>("??????"),&labelPos,&textColor,&fontSettings
);
local_8 = 4;
hiddenValuePos.x = columnX + 102.0;
hiddenValuePos.y = rowY + 0.0;
pos = &hiddenValuePos;
}
else {
pFVar3 = &g_manager->_font1_TeamMeatEx10;
local_8 = 0;
textColor._unk = 0;
textColor._red = 0.21176471;
textColor._green = 0.18431373;
textColor._blue = 0.1764706;
textColor._alpha = 1.0;
strCursor = statKey;
if (0xf < *GHIDRA_CAST<uint32_t *>((statKey + 0x14))) {
strCursor = *GHIDRA_CAST<uint8_t **>(statKey);
}
translatedText = string_table_translate(&g_manager->_stringTable,strCursor);
tmpStringSize = 0;
tmpStringCapacity = 0xf;
tmpString[0] = GHIDRA_CAST<uint8_t *****>(0x0);
strCursor = translatedText;
do {
strChar = *strCursor;
strCursor = strCursor + 1;
} while (strChar != 0);
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(tmpString))))->msvc::string::assign(translatedText,
GHIDRA_INT(strCursor) - GHIDRA_INT((translatedText + 1)));
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
pppppbVar4 = GHIDRA_CAST<uint8_t *****>(tmpString);
if (0xf < tmpStringCapacity) {
pppppbVar4 = tmpString[0];
}
Font::DrawStringScaled(pFVar3,GHIDRA_CAST<uint8_t *>(pppppbVar4),&labelPos,&textColor,&fontSettings);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0;
if (0xf < tmpStringCapacity) {
uVar5 = tmpStringCapacity + 1;
pppppbVar4 = tmpString[0];
if (0xfff < uVar5) {
pppppbVar4 = GHIDRA_CAST<uint8_t *****>(tmpString[0][-1]);
uVar5 = tmpStringCapacity + 0x24;
if (GHIDRA_CAST<uint8_t *>(0x1f) < GHIDRA_CAST<uint8_t *>((GHIDRA_INT(tmpString[0]) + (-4 - GHIDRA_INT(pppppbVar4)))))
goto LAB_008e718e;
}
operator_delete(pppppbVar4,uVar5);
}
tmpStringSize = 0;
tmpStringCapacity = 0xf;
tmpString[0] = GHIDRA_CAST<uint8_t *****>((GHIDRA_UINT(tmpString[0]) & 0xffffff00));
local_8 = 2;
valuePos.x = columnX + 102.0;
textColor._red = 0.21176471;
textColor._green = 0.18431373;
textColor._blue = 0.1764706;
textColor._alpha = 1.0;
valuePos.y = rowY + 0.0;
textColor._unk = 0;
pos = &valuePos;
}
local_68 = 0;
local_6c = 0;
local_70 = 0xffffffff;
local_74 = 0x3f800000;
local_78 = 0;
local_7c = 0xffff;
fontSettings = 2;
Font::DrawStringScaled(&g_manager->_font1_TeamMeatEx10,countText,pos,&textColor,&fontSettings);
rowY = rowY + 14.0;
labelPos.y = rowY;
if (statIndex == *GHIDRA_CAST<int *>((in_ECX + 0x124))) {
local_7c = 0x12cffff;
local_70 = 0xffffffff;
local_6c = 0;
local_68 = 0;
local_8 = 5;
fontSettings = 1;
local_78 = 1;
local_74 = 0x3f800000;
if (*GHIDRA_CAST<int *>((in_ECX + 0x34)) == 0) {
nullFrame = GHIDRA_CAST<float *>(0x0);
}
else {
nullFrame = AnimationState::GetNullFrame
(GHIDRA_CAST<AnimationState *>((in_ECX + 0x30)),GHIDRA_CAST<uint8_t *>("DescriptionPos"));
}
textColor._unk = 0;
descriptionPos.y = fVar2 + nullFrame[1];
descriptionPos.x = fVar1 + *nullFrame;
textColor._red = 0.21176471;
textColor._green = 0.18431373;
textColor._blue = 0.1764706;
textColor._alpha = 1.0;
if (statCount < 1) {
Font::DrawStringScaled
(&g_manager->_font1_TeamMeatEx10,GHIDRA_CAST<uint8_t *>("??????"),&descriptionPos,&textColor,
&fontSettings);
}
else {
keySize = *GHIDRA_CAST<std_string **>((statKey + 0x10));
pFVar3 = &g_manager->_font1_TeamMeatEx10;
if (0x7fffffffU - GHIDRA_INT(keySize) < 5) {
/* WARNING: Subroutine does not return */
msvc::string::_Xlen();
}
strCursor = statKey;
if (0xf < *GHIDRA_CAST<uint32_t *>((statKey + 0x14))) {
strCursor = *GHIDRA_CAST<uint8_t **>(statKey);
}
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(tmpString))))->msvc::string::concat(GHIDRA_INT(local_88.y),keySize,strCursor,
GHIDRA_UINT(keySize),GHIDRA_CAST<uint8_t *>("_DESC"),5);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 6;
pppppbVar4 = GHIDRA_CAST<uint8_t *****>(tmpString);
if (0xf < tmpStringCapacity) {
pppppbVar4 = tmpString[0];
}
translatedText = string_table_translate(&g_manager->_stringTable,GHIDRA_CAST<uint8_t *>(pppppbVar4));
descriptionTextSize = 0;
descriptionTextCapacity = 0xf;
descriptionText[0] = GHIDRA_CAST<uint8_t *****>(0x0);
strCursor = translatedText;
do {
strChar = *strCursor;
strCursor = strCursor + 1;
} while (strChar != 0);
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(descriptionText))))->msvc::string::assign(translatedText,
GHIDRA_INT(strCursor) - GHIDRA_INT((translatedText + 1)));
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 5;
if (0xf < tmpStringCapacity) {
uVar5 = tmpStringCapacity + 1;
pppppbVar4 = tmpString[0];
if (0xfff < uVar5) {
pppppbVar4 = GHIDRA_CAST<uint8_t *****>(tmpString[0][-1]);
uVar5 = tmpStringCapacity + 0x24;
if (GHIDRA_CAST<uint8_t *>(0x1f) < GHIDRA_CAST<uint8_t *>((GHIDRA_INT(tmpString[0]) + (-4 - GHIDRA_INT(pppppbVar4)))))
goto LAB_008e718e;
}
operator_delete(pppppbVar4,uVar5);
}
tmpStringSize = 0;
tmpStringCapacity = 0xf;
tmpString[0] = GHIDRA_CAST<uint8_t *****>((GHIDRA_UINT(tmpString[0]) & 0xffffff00));
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 7;
pppppbVar4 = GHIDRA_CAST<uint8_t *****>(descriptionText);
if (0xf < descriptionTextCapacity) {
pppppbVar4 = descriptionText[0];
}
Font::DrawStringScaled(pFVar3,GHIDRA_CAST<uint8_t *>(pppppbVar4),&descriptionPos,&textColor,&fontSettings);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 5;
if (0xf < descriptionTextCapacity) {
uVar5 = descriptionTextCapacity + 1;
pppppbVar4 = descriptionText[0];
if (0xfff < uVar5) {
pppppbVar4 = GHIDRA_CAST<uint8_t *****>(descriptionText[0][-1]);
uVar5 = descriptionTextCapacity + 0x24;
if (GHIDRA_CAST<uint8_t *>(0x1f) < GHIDRA_CAST<uint8_t *>((GHIDRA_INT(descriptionText[0]) + (-4 - GHIDRA_INT(pppppbVar4))))) {
LAB_008e718e:
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pppppbVar4,uVar5);
}
descriptionTextSize = 0;
descriptionTextCapacity = 0xf;
descriptionText[0] = GHIDRA_CAST<uint8_t *****>((GHIDRA_UINT(descriptionText[0]) & 0xffffff00));
}
}
local_8 = 0xffffffff;
statIndex = statIndex + 1;
statOffset = statOffset + 4;
statKey = statKey + 0x18;
if (0xadf < statOffset) {
ExceptionList = local_10;
return;
}
} while( true );
}
-4
View File
@@ -9056,7 +9056,6 @@ void Menu_Online::enter() { generated_stub("Menu_Online::enter 008e5260"); }
void Menu_Online::start_quick_match() { generated_stub("Menu_Online::start_quick_match 008e5420"); } void Menu_Online::start_quick_match() { generated_stub("Menu_Online::start_quick_match 008e5420"); }
void Menu_Online::render_descriptor(std_string *text) { generated_stub("Menu_Online::render_descriptor 008e5790"); } void Menu_Online::render_descriptor(std_string *text) { generated_stub("Menu_Online::render_descriptor 008e5790"); }
void Menu_Online::on_quick_match_search_result(int *param_1, int param_2) { generated_stub("Menu_Online::on_quick_match_search_result 008e5f40"); } void Menu_Online::on_quick_match_search_result(int *param_1, int param_2) { generated_stub("Menu_Online::on_quick_match_search_result 008e5f40"); }
void Menu_Online::render_descriptions() { generated_stub("Menu_Online::render_descriptions 008e6a80"); }
void Menu_OnlineLobby::update_list_cursor() { generated_stub("Menu_OnlineLobby::update_list_cursor 008db070"); } void Menu_OnlineLobby::update_list_cursor() { generated_stub("Menu_OnlineLobby::update_list_cursor 008db070"); }
void Menu_OnlineLobby::render_player_slots() { generated_stub("Menu_OnlineLobby::render_player_slots 008db8f0"); } void Menu_OnlineLobby::render_player_slots() { generated_stub("Menu_OnlineLobby::render_player_slots 008db8f0"); }
void Menu_OnlineLobby::Render() { generated_stub("Menu_OnlineLobby::Render 008ddae0"); } void Menu_OnlineLobby::Render() { generated_stub("Menu_OnlineLobby::Render 008ddae0"); }
@@ -9415,7 +9414,6 @@ EntityConfig * FUN_00417910() { generated_stub("FUN_00417910 00417910"); }
int FUN_00417920() { generated_stub("FUN_00417920 00417920"); } int FUN_00417920() { generated_stub("FUN_00417920 00417920"); }
void FUN_00417dd0() { generated_stub("FUN_00417dd0 00417dd0"); } void FUN_00417dd0() { generated_stub("FUN_00417dd0 00417dd0"); }
void FUN_00417df0() { generated_stub("FUN_00417df0 00417df0"); } void FUN_00417df0() { generated_stub("FUN_00417df0 00417df0"); }
void FUN_00417e50() { generated_stub("FUN_00417e50 00417e50"); }
int FUN_0041b770(int param_1) { generated_stub("FUN_0041b770 0041b770"); } int FUN_0041b770(int param_1) { generated_stub("FUN_0041b770 0041b770"); }
void FUN_0041c670() { generated_stub("FUN_0041c670 0041c670"); } void FUN_0041c670() { generated_stub("FUN_0041c670 0041c670"); }
int FUN_0041c6f0(uint32_t param_1) { generated_stub("FUN_0041c6f0 0041c6f0"); } int FUN_0041c6f0(uint32_t param_1) { generated_stub("FUN_0041c6f0 0041c6f0"); }
@@ -12200,8 +12198,6 @@ void FUN_008e6880(int *param_1) { generated_stub("FUN_008e6880 008e6880"); }
void FUN_008e68a0(char param_1, int param_2) { generated_stub("FUN_008e68a0 008e68a0"); } void FUN_008e68a0(char param_1, int param_2) { generated_stub("FUN_008e68a0 008e68a0"); }
void FUN_008e68e0() { generated_stub("FUN_008e68e0 008e68e0"); } void FUN_008e68e0() { generated_stub("FUN_008e68e0 008e68e0"); }
int * FUN_008e69a0(uint32_t param_1) { generated_stub("FUN_008e69a0 008e69a0"); } int * FUN_008e69a0(uint32_t param_1) { generated_stub("FUN_008e69a0 008e69a0"); }
void FUN_008e71c0() { generated_stub("FUN_008e71c0 008e71c0"); }
void Menu_OnlineAwards::Update() { generated_stub("Menu_OnlineAwards::Update 008e7250"); }
void FUN_008e74d0(uint8_t param_1) { generated_stub("FUN_008e74d0 008e74d0"); } void FUN_008e74d0(uint8_t param_1) { generated_stub("FUN_008e74d0 008e74d0"); }
int online_lobby_find_member_index(void *user) { generated_stub("online_lobby_find_member_index 008e7560"); } int online_lobby_find_member_index(void *user) { generated_stub("online_lobby_find_member_index 008e7560"); }
void FUN_008e7610() { generated_stub("FUN_008e7610 008e7610"); } void FUN_008e7610() { generated_stub("FUN_008e7610 008e7610"); }
+1 -1
View File
@@ -1023,7 +1023,7 @@ static void beast_background(Entity_NPC& npc, Room& room)
bool isWide = room.gridWidth >= BEAST_HORSEMAN_MIN_WIDTH && room.gridHeight >= BEAST_HORSEMAN_MIN_HEIGHT; bool isWide = room.gridWidth >= BEAST_HORSEMAN_MIN_WIDTH && room.gridHeight >= BEAST_HORSEMAN_MIN_HEIGHT;
Vector at = vector_add(room.GetGridPosition(isWide ? room.gridWidth * BEAST_HORSEMAN_ROW + BEAST_HORSEMAN_COLUMN : -1), Vector at = vector_add(room.GetGridPosition(isWide ? room.gridWidth * BEAST_HORSEMAN_ROW + BEAST_HORSEMAN_COLUMN : -1),
vector_make(BEAST_HORSEMAN_RIGHT, 0)); vector_make(BEAST_HORSEMAN_RIGHT, 0));
room.lastAliveBossCount = 0; room.entityList.bossMaxHealth = 0;
Entity* horseman = nullptr; Entity* horseman = nullptr;
if (npc.i1 < BEAST_HORSEMEN) if (npc.i1 < BEAST_HORSEMEN)
{ {
+1 -1
View File
@@ -572,7 +572,7 @@ static bool brownie_death(Entity_NPC& npc, BrownieFrame& frame)
npc.health = npc.maxHitPoints * BROWNIE_DANGLE_HEALTH; npc.health = npc.maxHitPoints * BROWNIE_DANGLE_HEALTH;
npc.maxHitPoints = npc.health; npc.maxHitPoints = npc.health;
} }
g_game->room->lastAliveBossCount = 0; g_game->room->entityList.bossMaxHealth = 0;
npc.entityCollisionClass = ENTCOLL_ALL; npc.entityCollisionClass = ENTCOLL_ALL;
npc.state = NPC_STATE_INIT; npc.state = NPC_STATE_INIT;
return true; return true;
+2 -2
View File
@@ -444,7 +444,7 @@ static void leech_explosion_init(Entity_Effect& explosion)
} }
// Part of 005cdb20 (Init's case 142) The whirlpool and its particles take the water's color, the particles on the // Part of 005cdb20 (Init's case 142) The whirlpool and its particles take the water's color, the particles on the
// floor on one of four idles. // floor on one of four idles (Idle1 to Idle4).
static void whirlpool_init(Entity_Effect& whirlpool) static void whirlpool_init(Entity_Effect& whirlpool)
{ {
ColorMod& water = g_game->room->fxLayers.fxParams.waterEffectColor; ColorMod& water = g_game->room->fxLayers.fxParams.waterEffectColor;
@@ -456,7 +456,7 @@ static void whirlpool_init(Entity_Effect& whirlpool)
} }
whirlpool.sortingLayer = SORTING_BACKGROUND; whirlpool.sortingLayer = SORTING_BACKGROUND;
int idle = whirlpool.dropRNG.RandomInt(WHIRLPOOL_PARTICLE_IDLES); int idle = whirlpool.dropRNG.RandomInt(WHIRLPOOL_PARTICLE_IDLES) + 1;
whirlpool.sprite.Play("Idle" + std::to_string(idle)); whirlpool.sprite.Play("Idle" + std::to_string(idle));
whirlpool.sprite.color = water; whirlpool.sprite.color = water;
for (int i = 0; i < 3; i++) whirlpool.sprite.color._offset[i] = WHIRLPOOL_PARTICLE_OFFSET; for (int i = 0; i < 3; i++) whirlpool.sprite.color._offset[i] = WHIRLPOOL_PARTICLE_OFFSET;
+3
View File
@@ -6,6 +6,7 @@
#include "entity/weapon/tear.h" #include "entity/weapon/tear.h"
#include "entity/familiar/gello.h" #include "entity/familiar/gello.h"
#include "entity/familiar/variants.h" #include "entity/familiar/variants.h"
#include "entity/familiar/wisp.h"
#include "entity/boss/ai.h" #include "entity/boss/ai.h"
#include "game/game.h" #include "game/game.h"
#include "level/generator.h" #include "level/generator.h"
@@ -904,6 +905,8 @@ void Entity_Familiar::room_enter()
case VANISHING_TWIN: vanishing_twin_room_enter(*this); break; case VANISHING_TWIN: vanishing_twin_room_enter(*this); break;
case UMBILICAL_BABY: umbilical_baby_room_enter(*this); break; case UMBILICAL_BABY: umbilical_baby_room_enter(*this); break;
case WISP: case WISP:
wisp_room_enter(*this);
[[fallthrough]];
case ITEM_WISP: pos = GetOrbitPosition(player->pos); break; case ITEM_WISP: pos = GetOrbitPosition(player->pos); break;
} }
+1
View File
@@ -46,6 +46,7 @@ void erased_enemy_add(Entity& enemy);
void wisp_kind_init(Entity_Familiar& wisp, int item); void wisp_kind_init(Entity_Familiar& wisp, int item);
void wisp_kind_colors(Entity_Familiar& wisp); void wisp_kind_colors(Entity_Familiar& wisp);
void wisp_kind_update(Entity_Familiar& wisp, WispShot& shot); void wisp_kind_update(Entity_Familiar& wisp, WispShot& shot);
void wisp_room_enter(Entity_Familiar& wisp);
void plum_flute_wisp_target(Entity_Familiar& wisp); void plum_flute_wisp_target(Entity_Familiar& wisp);
void plum_flute_wisp_spray(Entity_Familiar& wisp, int updateSteps); void plum_flute_wisp_spray(Entity_Familiar& wisp, int updateSteps);
bool wisp_kind_fire(Entity_Familiar& wisp, Vector velocity); bool wisp_kind_fire(Entity_Familiar& wisp, Vector velocity);
+19
View File
@@ -213,6 +213,7 @@ constexpr float MONSTER_SPEED_MIN = 0.7f;
constexpr uint32_t D8_DELAY_SPREAD = 5; constexpr uint32_t D8_DELAY_SPREAD = 5;
constexpr int D8_DELAY_SHIFT = -2; constexpr int D8_DELAY_SHIFT = -2;
constexpr int D8_SHIFT_INDEX = 13; constexpr int D8_SHIFT_INDEX = 13;
constexpr int RED_KEY_WISP_SHIFT_INDEX = 7;
constexpr float WAVY_CAP_STACK = 0.75f; constexpr float WAVY_CAP_STACK = 0.75f;
constexpr float WAVY_CAP_NULL_STACK = 0.3f; constexpr float WAVY_CAP_NULL_STACK = 0.3f;
constexpr float WAVY_CAP_ROOT = 0.23f; constexpr float WAVY_CAP_ROOT = 0.23f;
@@ -1015,6 +1016,24 @@ void plum_flute_wisp_target(Entity_Familiar& wisp)
} }
} }
// Part of 0062bb70 (a new room, a wisp's case): Mr. Me!'s wisp drops its errand and rejoins its ring, Red Key's opens a
// red room through the wall its room's spawn seed picks when it can.
void wisp_room_enter(Entity_Familiar& wisp)
{
if (wisp.subtype == COLLECTIBLE_MR_ME)
{
wisp.keys = MR_ME_IDLE;
wisp.velocity = {};
if (wisp.orbitLayer < 0) wisp.AddToOrbit(wisp_config(wisp)->layer + WISP_RING_OFFSET);
}
else if (wisp.subtype == COLLECTIBLE_RED_KEY)
{
int slot = (int)(rng_make(g_game->room->descriptor->spawnSeed, RED_KEY_WISP_SHIFT_INDEX).Next() % DOOR_SLOT_COUNT);
if (!g_game->room->doors[slot] && g_game->CanSpawnDoorOutline(g_game->currentRoomIdx, slot))
g_game->MakeRedRoomDoor(g_game->currentRoomIdx, slot);
}
}
// The end of 0043aa90 for the Plum Flute's wisp spraying: it flies along a diagonal, spraying blood tears behind it // The end of 0043aa90 for the Plum Flute's wisp spraying: it flies along a diagonal, spraying blood tears behind it
// every fourth update with a fart, its animation facing up or down. // every fourth update with a fart, its animation facing up or down.
void plum_flute_wisp_spray(Entity_Familiar& wisp, int updateSteps) void plum_flute_wisp_spray(Entity_Familiar& wisp, int updateSteps)
+13
View File
@@ -241,6 +241,19 @@ EntityList::EntityList()
Reset(); Reset();
} }
// 00417e50 Removes every entity still listed, the persistent ones too, so their pools hand them out again.
EntityList::~EntityList()
{
for (EntityList_EL* list : {&mainEL, &persistentEL})
for (size_t i = 0; i < list->size(); i++)
{
Entity* entity = (*list)[i];
entity->ClearReferences();
entity->isValid = false;
entity->Remove();
}
}
// 00418230 Removes every entity but the persistent ones, and starts the lists over with those. // 00418230 Removes every entity but the persistent ones, and starts the lists over with those.
void EntityList::Reset() void EntityList::Reset()
{ {
+1
View File
@@ -157,6 +157,7 @@ struct EntityList
bool isAnyBaited = false; bool isAnyBaited = false;
EntityList(); EntityList();
~EntityList();
EntityList(const EntityList&) = delete; EntityList(const EntityList&) = delete;
EntityList& operator=(const EntityList&) = delete; EntityList& operator=(const EntityList&) = delete;
+15 -23
View File
@@ -1270,31 +1270,23 @@ void Entity_NPC::status_overlay_update()
(g_game->challenge != CHALLENGE_SPEED && g_game->room->brokenWatchState == BROKEN_WATCH_SLOW); (g_game->challenge != CHALLENGE_SPEED && g_game->room->brokenWatchState == BROKEN_WATCH_SLOW);
bool isTimeImmune = (flags & (FLAG_FRIENDLY | FLAG_NO_STATUS_EFFECTS)) && type != ENTITY_DEATHS_HEAD; bool isTimeImmune = (flags & (FLAG_FRIENDLY | FLAG_NO_STATUS_EFFECTS)) && type != ENTITY_DEATHS_HEAD;
// Each status overrides the ones before it, so the last that applies shows. Charm overrides them all. // The first status that applies shows, charm before all, the crown or skull when none does.
std::string_view animation; std::string_view animation;
bool isShared = championColorIdx == CHAMPION_KING; bool isShared = true;
if (championColorIdx == CHAMPION_KING) animation = "Crown"; if (HasEntityFlags(FLAG_CHARM) && !isShadowCharger) animation = "Charm";
else if (HasEntityFlags(FLAG_BRIMSTONE_MARKED)) animation = "BrimstoneCurse";
else if (HasEntityFlags(FLAG_MAGNETIZED)) animation = "Magnetize";
else if (HasEntityFlags(FLAG_BAITED)) animation = "Bait", isShared = false;
else if (HasEntityFlags(FLAG_CONFUSION)) animation = "Confuse";
else if (HasEntityFlags(FLAG_BURN)) animation = "Burning", isShared = false;
else if (HasEntityFlags(FLAG_POISON)) animation = "Poison";
else if (HasEntityFlags(FLAG_FEAR)) animation = "Fear";
else if (HasEntityFlags(FLAG_BLEED_OUT)) animation = "BleedingOut";
else if (HasEntityFlags(FLAG_SLOW) || (isTimeSlowed && !isTimeImmune)) animation = "Slow";
else if (HasEntityFlags(FLAG_WEAKNESS)) animation = "Weakness";
else if (type == ENTITY_SIREN_HELPER) animation = "EnemyCharm";
else if (championColorIdx == CHAMPION_KING) animation = "Crown";
else if (championColorIdx == CHAMPION_DEATH) animation = "Skull"; else if (championColorIdx == CHAMPION_DEATH) animation = "Skull";
if (HasEntityFlags(FLAG_CHARM) && !isShadowCharger)
{
animation = "Charm";
isShared = true;
}
else
{
if (HasEntityFlags(FLAG_BRIMSTONE_MARKED)) animation = "BrimstoneCurse";
if (HasEntityFlags(FLAG_MAGNETIZED)) animation = "Magnetize";
if (HasEntityFlags(FLAG_BAITED)) animation = "Bait", isShared = false;
if (HasEntityFlags(FLAG_CONFUSION)) animation = "Confuse";
if (HasEntityFlags(FLAG_BURN)) animation = "Burning", isShared = false;
if (HasEntityFlags(FLAG_POISON)) animation = "Poison";
if (HasEntityFlags(FLAG_FEAR)) animation = "Fear";
if (HasEntityFlags(FLAG_BLEED_OUT)) animation = "BleedingOut";
if (HasEntityFlags(FLAG_SLOW) || (isTimeSlowed && !isTimeImmune)) animation = "Slow";
if (HasEntityFlags(FLAG_WEAKNESS)) animation = "Weakness";
if (type == ENTITY_SIREN_HELPER) animation = "EnemyCharm";
}
if (animation.empty()) if (animation.empty())
{ {
if (statusEffectSprite.animState.animData) statusEffectSprite.animState.isPlaying = false; if (statusEffectSprite.animState.animData) statusEffectSprite.animState.isPlaying = false;
+5 -2
View File
@@ -1642,14 +1642,17 @@ static bool is_sized_variant(int variant)
variant == TEAR_SPORE; variant == TEAR_SPORE;
} }
// The sized animation's name for a variant and its number. // The sized animation's name for a variant and its number. Tooth, coin and stone tears have half as many sizes.
static std::string sized_animation_name(int variant, int number) static std::string sized_animation_name(int variant, int number)
{ {
const char* format = "RegularTear%d"; const char* format = "RegularTear%d";
if (is_listed(BLOOD_ANIMATION_VARIANTS, variant)) format = "BloodTear%d"; bool isHalved = true;
if (is_listed(BLOOD_ANIMATION_VARIANTS, variant)) format = "BloodTear%d", isHalved = false;
else if (variant == TEAR_TOOTH || variant == TEAR_BLACK_TOOTH) format = "Tooth%dMove"; else if (variant == TEAR_TOOTH || variant == TEAR_BLACK_TOOTH) format = "Tooth%dMove";
else if (variant == TEAR_COIN) format = "Rotate%d"; else if (variant == TEAR_COIN) format = "Rotate%d";
else if (is_listed(STONE_ANIMATION_VARIANTS, variant)) format = "Stone%dMove"; else if (is_listed(STONE_ANIMATION_VARIANTS, variant)) format = "Stone%dMove";
else isHalved = false;
if (isHalved) number = std::max(number / 2, 1);
char name[TEAR_ANIMATION_NAME_SIZE]; char name[TEAR_ANIMATION_NAME_SIZE];
std::snprintf(name, sizeof(name), format, number); std::snprintf(name, sizeof(name), format, number);
+3 -1
View File
@@ -441,9 +441,11 @@ void Game::ResetState()
} }
// 007384d0 Replaces the current room with a new one and clears the floor: no rooms, stage, curses or Greed waves. // 007384d0 Replaces the current room with a new one and clears the floor: no rooms, stage, curses or Greed waves.
// The old room stays current while it is deleted, as its entities' removal reads it.
void Game::level_reset() void Game::level_reset()
{ {
room.reset(); delete room.get();
room.release();
room = std::make_unique<Room>(); room = std::make_unique<Room>();
startingRoomIdx = -1; startingRoomIdx = -1;
nbRooms = 0; nbRooms = 0;
+1 -1
View File
@@ -337,7 +337,7 @@ static void room_reset(Room& room)
room.entityList.Reset(); room.entityList.Reset();
room.entityIndexCounter = 0; room.entityIndexCounter = 0;
for (Entity* entity : room.entityList.updateEL) entity->index = room.entityIndexCounter++; for (Entity* entity : room.entityList.updateEL) entity->index = room.entityIndexCounter++;
room.lastAliveBossCount = 0; room.bossesRemaining = 0;
for (int i = 0; i < ROOM_ITEM_COUNTER_COUNT; i++) for (int i = 0; i < ROOM_ITEM_COUNTER_COUNT; i++)
if (!(ROOM_ITEM_COUNTERS_KEPT >> i & 1)) room.itemCounters[i] = 0; if (!(ROOM_ITEM_COUNTERS_KEPT >> i & 1)) room.itemCounters[i] = 0;
-1
View File
@@ -251,7 +251,6 @@ public:
int greedWaveTimer = 0; int greedWaveTimer = 0;
int gridHeight = 0; int gridHeight = 0;
int gridWidth = 0; int gridWidth = 0;
int lastAliveBossCount = 0;
int numRainSpawners = 0; int numRainSpawners = 0;
int roomClearDelay = 0; int roomClearDelay = 0;
int secondBossId = 0; int secondBossId = 0;
+3 -2
View File
@@ -1428,14 +1428,15 @@ void Room::Update()
if ((roomType == ROOM_CHALLENGE || roomType == ROOM_BOSSRUSH) && game.ambush.isActive) game.ambush.Update(); if ((roomType == ROOM_CHALLENGE || roomType == ROOM_BOSSRUSH) && game.ambush.isActive) game.ambush.Update();
if (isCardAgainstHumanity) card_against_humanity_fill(); if (isCardAgainstHumanity) card_against_humanity_fill();
// The bosses still counted are the living ones from here on, warning when some left without TriggerBossDeath.
int bosses = GetAliveBossesCount(); int bosses = GetAliveBossesCount();
if (bosses < 1 && lastAliveBossCount > 0) if (bosses < 1 && bossesRemaining > 0)
{ {
if (g_manager->netplayManager.is_online()) if (g_manager->netplayManager.is_online())
KAGE_LogMessage(LOG_INFO, (uint8_t*)("[Frame " + std::to_string(game.frameCount) + "] ").c_str()); KAGE_LogMessage(LOG_INFO, (uint8_t*)("[Frame " + std::to_string(game.frameCount) + "] ").c_str());
KAGE_LogMessage(LOG_INFO, (uint8_t*)"[warn] last boss died without triggering the deathspawn.\n"); KAGE_LogMessage(LOG_INFO, (uint8_t*)"[warn] last boss died without triggering the deathspawn.\n");
} }
lastAliveBossCount = bosses; bossesRemaining = bosses;
entityList.Update(UPDATE_NORMAL); entityList.Update(UPDATE_NORMAL);
fxLayers.Update(PLAYER_FOLLOW_EASE); fxLayers.Update(PLAYER_FOLLOW_EASE);
+11 -3
View File
@@ -256,6 +256,10 @@ void MenuManager::menus_init()
menuBestiary.Init(menu_position_get(MENU_BESTIARY)); menuBestiary.Init(menu_position_get(MENU_BESTIARY));
log_printf(LOG_INFO, "Menu Custom Challenge Init\n"); log_printf(LOG_INFO, "Menu Custom Challenge Init\n");
menuCustomChallenge.Init(menu_position_get(MENU_CUSTOM_CHALLENGE)); menuCustomChallenge.Init(menu_position_get(MENU_CUSTOM_CHALLENGE));
log_printf(LOG_INFO, "Menu Online Awards Init\n");
onlineAwardsPosition = menu_position_get(MENU_ONLINE_AWARDS);
online_awards_load();
online_awards_reset();
} }
// 00988ba0 Drops every menu's sprites, as a run starts. // 00988ba0 Drops every menu's sprites, as a run starts.
@@ -279,6 +283,7 @@ void MenuManager::unload_graphics()
menuBestiary.unload_graphics(); menuBestiary.unload_graphics();
menuCustomChallenge.customChallengeSprite.Reset(); menuCustomChallenge.customChallengeSprite.Reset();
menuMods.modsMenuSprite.Reset(); menuMods.modsMenuSprite.Reset();
onlineStatsMenuSprite.Reset();
} }
// 00988d80 Loads every menu's sprites again, as the menus come back. // 00988d80 Loads every menu's sprites again, as the menus come back.
@@ -301,6 +306,7 @@ void MenuManager::LoadGraphics()
menuBestiary.load_graphics(); menuBestiary.load_graphics();
menuCustomChallenge.LoadGraphics(); menuCustomChallenge.LoadGraphics();
menuMods.LoadGraphics(); menuMods.LoadGraphics();
online_awards_load();
} }
// 00989750 Fades the menus out into the run to the start jingle, loading the loading screen for the start seed. // 00989750 Fades the menus out into the run to the start jingle, loading the loading screen for the start seed.
@@ -399,7 +405,7 @@ void MenuManager::Update()
color_mod_update(); color_mod_update();
} }
// Steps the selected menu. The online menus are never selected offline. // Steps the selected menu. The online menus besides the awards are never selected offline.
void MenuManager::menu_update() void MenuManager::menu_update()
{ {
switch (selectedMenuId) switch (selectedMenuId)
@@ -420,6 +426,7 @@ void MenuManager::menu_update()
case MENU_BESTIARY: menuBestiary.Update(); break; case MENU_BESTIARY: menuBestiary.Update(); break;
case MENU_CUSTOM_CHALLENGE: menuCustomChallenge.Update(); break; case MENU_CUSTOM_CHALLENGE: menuCustomChallenge.Update(); break;
case MENU_MODS: menuMods.Update(); break; case MENU_MODS: menuMods.Update(); break;
case MENU_ONLINE_AWARDS: online_awards_update(); break;
default: break; default: break;
} }
} }
@@ -483,6 +490,7 @@ void MenuManager::Render()
menuCutscenes.Render(); menuCutscenes.Render();
menuCustomChallenge.Render(); menuCustomChallenge.Render();
menuMods.Render(); menuMods.Render();
online_awards_render();
menuSave.Render(); menuSave.Render();
menuDailyChallenge.leaderboard.Render(); menuDailyChallenge.leaderboard.Render();
flySprite.Render(menu_draw_get(vector_make(scrollInterpolationX, scrollInterpolationY))); flySprite.Render(menu_draw_get(vector_make(scrollInterpolationX, scrollInterpolationY)));
@@ -732,8 +740,8 @@ SeedsEntry MenuManager::transition_other_apply(MenuState previous, MenuState sta
case MENU_ONLINE_LOBBY_LIST: case MENU_ONLINE_LOBBY_LIST:
case MENU_ONLINE: case MENU_ONLINE:
case MENU_ONLINE_OPTIONS: case MENU_ONLINE_OPTIONS:
case MENU_CREATE_LOBBY: case MENU_CREATE_LOBBY: return SEEDS_ENTRY_KEEP;
case MENU_ONLINE_AWARDS: return SEEDS_ENTRY_KEEP; case MENU_ONLINE_AWARDS: online_awards_reset(); return SEEDS_ENTRY_KEEP;
default: return SEEDS_ENTRY_RESET; default: return SEEDS_ENTRY_RESET;
} }
} }
+19 -1
View File
@@ -124,10 +124,20 @@ constexpr int SOUND_MENU_NOTE_APPEAR = 283;
constexpr int SOUND_MENU_NOTE_HIDE = 284; constexpr int SOUND_MENU_NOTE_HIDE = 284;
constexpr ColorModState COLOR_MOD_NONE = {1, 1, 1, 0, 0, 1}; constexpr ColorModState COLOR_MOD_NONE = {1, 1, 1, 0, 0, 1};
// The directions the online awards page moves its cursor by, each with its hold counter in this order.
enum OnlineAwardsDirection
{
ONLINE_AWARDS_UP,
ONLINE_AWARDS_DOWN,
ONLINE_AWARDS_LEFT,
ONLINE_AWARDS_RIGHT,
ONLINE_AWARDS_DIRECTION_COUNT
};
// Copies are never made. Destruction (00986f30) is the default. // Copies are never made. Destruction (00986f30) is the default.
// The main menu (g_menuManager): every menu laid out on one sheet the view scrolls across, the history of menus // The main menu (g_menuManager): every menu laid out on one sheet the view scrolls across, the history of menus
// opened, the fades, the fly, the shadow and overlay over everything, and the color modifier it all renders through. // opened, the fades, the fly, the shadow and overlay over everything, and the color modifier it all renders through.
// The online menus are offline: they are never built, entered or drawn. // The online menus are offline: they are never built, entered or drawn, but for the online awards page the stats open.
class MenuManager class MenuManager
{ {
public: public:
@@ -144,6 +154,10 @@ public:
KAGE::Graphics::ImagePtr menuOverlayImage; KAGE::Graphics::ImagePtr menuOverlayImage;
ANM2 flySprite; ANM2 flySprite;
ANM2 menuShadowSprite; ANM2 menuShadowSprite;
ANM2 onlineStatsMenuSprite;
std::array<int, ONLINE_AWARDS_DIRECTION_COUNT> onlineAwardsHoldFrames{};
Vector onlineAwardsPosition{};
int onlineAwardsSelected = 0;
Menu_Title menuTitle; Menu_Title menuTitle;
Menu_Save menuSave; Menu_Save menuSave;
@@ -208,6 +222,10 @@ private:
void overlay_render(); void overlay_render();
void color_mod_render(); void color_mod_render();
void fades_render(); void fades_render();
void online_awards_load();
void online_awards_reset();
void online_awards_update();
void online_awards_render();
}; };
extern KAGE::Graphics::ImagePtr menuColorModSurface; extern KAGE::Graphics::ImagePtr menuColorModSurface;
+122
View File
@@ -0,0 +1,122 @@
#include "engine/font.h"
#include "game/game.h"
#include "game/manager.h"
#include "ui/menu/manager.h"
#include <string>
constexpr const char* ONLINE_STATS_ANM2 = "gfx/ui/main menu/OnlineStatsMenu.anm2";
constexpr const char* CURSOR_LAYER = "Cursor";
constexpr const char* TEXT_START_NULL = "TextStartPos";
constexpr const char* DESCRIPTION_NULL = "DescriptionPos";
constexpr const char* UNKNOWN_TEXT = "??????";
constexpr const char* DESCRIPTION_SUFFIX = "_DESC";
// The grid: columns of seven awards, three of them.
constexpr int AWARD_ROWS = 7;
constexpr int AWARD_GRID_SPAN = COOP_AWARD_COUNT - AWARD_ROWS;
// A held direction moves once, then again every eighth frame once held past the 39th.
constexpr int HOLD_DELAY = 39;
constexpr int HOLD_INTERVAL = 8;
// The text: each column 126 wide with its count 102 in, rows 14 apart, descriptions wrapped at 300.
constexpr float COLUMN_WIDTH = 126;
constexpr float COUNT_OFFSET_X = 102;
constexpr float ROW_HEIGHT = 14;
constexpr uint16_t DESCRIPTION_WIDTH = 300;
constexpr KColor TEXT_COLOR = kcolor_rgba(0.21176471f, 0.18431373f, 0.1764706f, 1);
constexpr float UNKNOWN_ALPHA = 0.8f;
// The award counters the event counters keep, in the order of COOP_AWARD_KEYS.
constexpr int AWARD_COUNTER_FIRST = 500;
// Loads the online awards page, idling (inlined in MenuManager::Init and MenuManager::LoadGraphics).
void MenuManager::online_awards_load()
{
onlineStatsMenuSprite.Load(ONLINE_STATS_ANM2, GRAPHICS_LOAD);
onlineStatsMenuSprite.Play(ANIMATION_IDLE);
}
// 008e71c0 Idles the online awards page (an unforced play) and forgets the held directions.
void MenuManager::online_awards_reset()
{
onlineStatsMenuSprite.Play(ANIMATION_IDLE);
onlineAwardsHoldFrames = {};
}
// Whether a direction is held this frame and moves the cursor now, counting how long it has been held.
static bool is_direction_step(ButtonAction action, int& held)
{
if (!is_action(action, ACTION_PRESSED))
{
held = 0;
return false;
}
bool isStep = held == 0 || (held > HOLD_DELAY && held % HOLD_INTERVAL == 0);
held++;
return isStep;
}
// 008e7250 (Menu_OnlineAwards::Update) Steps the online awards page every other frame (MenuManager::Update's part),
// then back leaves and the directions move the cursor, wrapping within its column or row. The cursor layer shows the
// selected award.
void MenuManager::online_awards_update()
{
std::array<int, ONLINE_AWARDS_DIRECTION_COUNT>& held = onlineAwardsHoldFrames;
int& selected = onlineAwardsSelected;
if ((g_manager->framecount & 1) == 0 && onlineStatsMenuSprite.isLoaded) onlineStatsMenuSprite.Update();
if (is_action(ACTION_MENU_BACK, ACTION_TRIGGERED)) pop_menu();
if (is_direction_step(ACTION_MENU_UP, held[ONLINE_AWARDS_UP]))
selected += selected % AWARD_ROWS != 0 ? -1 : AWARD_ROWS - 1;
if (is_direction_step(ACTION_MENU_DOWN, held[ONLINE_AWARDS_DOWN]))
selected += selected % AWARD_ROWS != AWARD_ROWS - 1 ? 1 : 1 - AWARD_ROWS;
if (is_direction_step(ACTION_MENU_LEFT, held[ONLINE_AWARDS_LEFT]))
selected += selected < AWARD_ROWS ? AWARD_GRID_SPAN : -AWARD_ROWS;
if (is_direction_step(ACTION_MENU_RIGHT, held[ONLINE_AWARDS_RIGHT]))
selected += selected >= AWARD_GRID_SPAN ? -AWARD_GRID_SPAN : AWARD_ROWS;
onlineStatsMenuSprite.SetLayerFrame(CURSOR_LAYER, selected);
}
// 008e6a80 (Menu_OnlineAwards::Render) Draws the online awards page, then each award's name and count down its column
// (both "??????" faded until won), and the selected award's description wrapped under the grid.
// The original reads the null frames of a page with no animation. Nothing is written then.
void MenuManager::online_awards_render()
{
Font& font = g_manager->font1_TeamMeatEx10;
std::array<int, EVENT_COUNTER_COUNT>& counters = g_manager->persistentGameData.eventCounters;
SpriteDraw draw = menu_draw_get(onlineAwardsPosition);
Vector scale = vector_make(1, 1);
if (onlineStatsMenuSprite.isLoaded) onlineStatsMenuSprite.Render(draw);
const NullFrame* textStart = onlineStatsMenuSprite.GetNullFrame(TEXT_START_NULL);
const NullFrame* description = onlineStatsMenuSprite.GetNullFrame(DESCRIPTION_NULL);
if (!textStart || !description) return;
Vector start = vector_add(draw.position, textStart->pos);
Vector label = start;
for (int award = 0; award < COOP_AWARD_COUNT; award++)
{
int count = counters[AWARD_COUNTER_FIRST + award];
bool isWon = count >= 1;
KColor color = TEXT_COLOR;
if (!isWon) color._alpha = UNKNOWN_ALPHA;
if (award > 0 && award % AWARD_ROWS == 0) label = vector_make(label.x + COLUMN_WIDTH, start.y);
FontSettings labelSettings;
font.DrawString(isWon ? g_manager->stringTable.translate(COOP_AWARD_KEYS[award]) : UNKNOWN_TEXT, label, scale,
color, labelSettings);
FontSettings countSettings(ALIGN_TOP_RIGHT);
font.DrawString(std::to_string(count), vector_make(label.x + COUNT_OFFSET_X, label.y), scale, color,
countSettings);
label.y += ROW_HEIGHT;
if (award != onlineAwardsSelected) continue;
FontSettings descriptionSettings(ALIGN_TOP_CENTER);
descriptionSettings.EnableAutoWrap(DESCRIPTION_WIDTH);
std::string key = std::string(COOP_AWARD_KEYS[award]) + DESCRIPTION_SUFFIX;
font.DrawString(isWon ? g_manager->stringTable.translate(key) : UNKNOWN_TEXT,
vector_add(draw.position, description->pos), scale, TEXT_COLOR, descriptionSettings);
}
}